Question

does anyone know what is the difference between log4d vs log4delphi? could you recommend one of them that you used and satisfied with ? or claim they are the same? or do you use other "logger" that you could recommend ?

in the site of log4delphi it states:

Log4D last updated their CVS 16 Months ago, the project has had no recent activity since then. They also have no file releases which means new users would have to get source code from the CVS repository which is not good.

Log4D is also a direct port of Log4J while Log4Delphi is loosely based on Log4J which means that Log4Delphi does not have to follow what Log4J is doing, we can deviate from log4j at any time, which is a good thing, considering the numerous differences between Java and Delphi.

update: after working with te delphi4d , it is possible to export to html this way:

uses log4d;
var
  appender:TLogFileAppender;
  logger:TLoglogger;
begin
  appender := TLogRollingFileAppender.Create('name','log.html');
  appender.Layout := TLogHTMLLayout.Create;
  TLogBasicConfigurator.Configure(appender);    
  TLogLogger.GetRootLogger.Level := All;
  Logger := TLogLogger.GetLogger('loggerName');
    Logger.Fatal('fatal output');
    Logger.Error('error output');
    Logger.Warn('warn output');
    Logger.Info('info output');
    Logger.Debug('starting debug');
end;

update2:log4delphi is released for delphi 6 or delphi 7. meaning extra work needs to upgrade to later delphi.

update 3: log4d is the same as log4j, and very fast to pickup and use.

Was it helpful?

Solution

To add another "logger", as you requested, I recommend our Open Source logging classes.

It has a "KISS" design, very diverse from Log4J and all Log4* adaptations. Idea was to develop something fast, stable, powerful and dedicated to Delphi for business applications. For instance, it does not create XML files, but plain text files.

It has logging features (with a set of levels, not a hierarchy of level), can serialize content, exception interception with stack trace (and unit / method name with line numbers!), method execution timing, log compression and auto-archival.

A log viewer is available and very fast, and allows method profiling from any log file.

We use it on production for huge programs, from Delphi 5 up to XE3, with a lot of benefit. Just having the exceptions logged, and execution timing changes everything.

It is part of our mORMot framework, but can used without it. Just some units to link, and that's all.

It is free, and maintained, whereas your Log4D* projects sounds not yet active.

OTHER TIPS

As you can read in the FAQ you're referencing, they are not the same.

You can easily confirm this by downloading both and comparing the files.

While Log4D last download (log4d-src 0.9 2007-06-12) 38.2 Kb contains just 4 pas files, Log4Delphi last download (log4delphi 0.8 Melloware 2010-11-16) 1.7 Mb contains 27 pas files just in the src/delphi folder, plus other folders with unit tests and packages.

Also comparing the dtd both projects contains shows the xml format is different and incompatible.

Both projects looks outdated. Log4Delphi includes packages for D6 and D7.

If one is based in the other, I don't know. Log4Delphi looks more complex, even the 0.1 version have a very different file set.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top