在log4delphi的网站上它说:
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.
更新:
使用te delphi4d后,可以这样导出到html:
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是针对delphi 6或delphi 7发布的.这意味着额外的工作需要升级到以后的delphi.
更新3:
log4d与log4j相同,拾取和使用非常快.
解决方法
它采用“KISS”设计,与Log4J和所有Log4 *改编版本截然不同.想法是开发快速,稳定,强大的东西,致力于Delphi的商业应用.例如,它不会创建XML文件,而是创建纯文本文件.
它具有日志记录功能(具有一组级别,而不是级别的层次结构),可以序列化内容,使用堆栈跟踪进行异常拦截(以及带行号的单元/方法名称!),方法执行时序,日志压缩和自动存档.
log viewer可用且速度非常快,并允许从任何日志文件进行方法分析.
我们将它用于大型程序的生产,从Delphi 5到XE3,具有很多好处.只记录异常,执行时间会改变一切.
它是我们的mORMot框架的一部分,但可以在没有它的情况下使用.只是一些链接的单位,这就是全部.
它是免费的,并且是维护的,而你的Log4D *项目听起来还不活跃.