开发者

How can I log events to the event log and optionally to a file easily with Delphi?

I'm primarily looking for suggestions on logging comp开发者_JS百科onents or libraries that are available at low or no cost. I have a Windows service and a client application that both need support for logging to a file. The service needs to also support logging the exact same messages to the event log as well.

I can write something, but if this wheel already exists it would be helpful!

UPDATE: Turns out my question is a duplicate:

  • What's the Best Logging Package for Delphi?
  • Which logging library is better?


I recommend the Log4D open source library:

it requires only one file (Log4D.pas), allows dynamic configuration in code and external configuration through a properties file (flat or XML), and is very easy to use and extend - writing a new appender class which can be configured from the properties file is simple.


For the open source alternative, it sounds like you need the extensible Log4Delphi


I also just found this one: TraceTool Short description from the source site:

The Swiss-Army knife of trace

A C#, C++, Delphi, ActiveX and Java trace framework and a trace viewer: Tail, outputDebugString, event log, and with Log4J, Log4Net

This came from a similar StackOverflow question Which logging library is better?

There's also another similar question: https://stackoverflow.com/questions/84798/whats-the-best-logging-package-for-delphi


this question has been asked many times, and some got really good answers: Which logging library is better?

and

How can I find out which exceptions a Delphi function might throw?


For a commercial solution (and commercial costs), the oldest (?) is CodeSite from Raize.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜