Thema: EstLogger

Einzelnen Beitrag anzeigen

Benutzerbild von Baldo
Baldo

Registriert seit: 27. Sep 2004
7 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: EstLogger

  Alt 2. Nov 2004, 19:32
Well, okay, here it comes:

What is EstLogger?

EstLogger is a logging solution that allows developpers to log any kind of information from their application to external log files. The logger is ment to help programmers solve problems in their code, but offcourse logging can be used for all kinds of purposes (progress logging, error logging, flow logging, etc).

How to use EstLogger?

Implementing logging in an application is done by making use of the EstLogger singleton, added to a program by simply including a unit. Sending a message to a log is a straightforward method call on the logger object: EstLogger.Send.

The logger singleton has several overloads of the send method to allow the programmer to easily send different types of data (strings, integers, floats, images and even complete stream content).

Next to sending regular messages, the logger also has methods for program flow messages. EnterMethod and ExitMethod are two methods that can be send when entering en exiting a class method (or procedure) so the logs shows where to program executing is at a given time. SendWarning and SendException can be used to log (possible) error situations.

There is also a method to mail the application log. This allows a programmers to be informed about on-site information on what happens in an application. Programmers can then respond on errors in their programs before their users may even notice them.

How does EstLogger work?

Logging is non-blocking (by making use of Windows messages) and log messages are captured and stored by an external application. This "logger application" runs on the computer along with the application sending the log messages. The logger application can run as a tray icon or in the background.

Logs are stored on disks on a location that can be dynamically configured using a configuration file. Log sizes can be configured and older logs are automatically compressed and stored at a customizable location.

There is a separate application available to view logs. This viewer has a few more capabilities than the logger application like browsing through archived logs and saving logs to XML (under construction at the moment).

So what’s in the package?

The Delphi project group constist of 4 projects:

1. The logger

This is the application that catches the log messages from one or more application that is logging messages and saves them to a log on disk.

2. The log viewer

This application allows logs or archived logs to be viewed.

3. A logger test application

This application demonstrates how to use the logger from Delphi code.

4. A logger package

When building applications with runtime packages, this package contains all units needed to use the logger singleton.

Why use EstLogger and not CodeSite or Log4D?

Well, I have personally used CodeSite in the past with great pleasure. The only thing that bothered me with CodeSite was that the CodeSite viewer was not available to the customer as but only to the developper. But other than that: a great product which you should really buy if you want to do some serious logging.

I do not know Log4D, but looking at the code in the package downloaded from CodeCentral it looks that Log4D does almost the same as EstLogger does, but in a blocking way (writing a message to the log blocks the program flow until it has been written). An the non-blocking part it what I like most about CodeSite and my own logger.

But the main reason to use EstLogger for me: it's free, open source, contains the parts of CodeSite I like the best and is fun to build.

What happens to EstLogger in the future?

Well, EstLogger is being used in the backoffice system of the company I work at. Messages from 40+ workstations will be logged to a central network location and are used to keep track of how the backoffice system is used and what can be improved. Depending on the needs at my work and requests from other users I will extend the logger class, the logger application and the viewer to be solid, stable, cool and educational product.

Currently I am working on the facilities to save logs as an xml file, and I have plans to create a logger http server facility (so you can browse to the logger on a machine on the network). I am open to good ideas offcourse and when my spare time alows it, I'll build more features.
  Mit Zitat antworten Zitat