Mick
Mick

Reputation: 13475

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 components 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:

Upvotes: 3

Views: 478

Answers (5)

mjn
mjn

Reputation: 36654

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.

Upvotes: 1

number5
number5

Reputation: 16443

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?

Upvotes: 1

Darian Miller
Darian Miller

Reputation: 8088

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

Upvotes: 1

Darian Miller
Darian Miller

Reputation: 8088

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

Upvotes: 0

Darian Miller
Darian Miller

Reputation: 8088

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

Upvotes: 1

Related Questions