dimanche 1 mars 2020

Log Something Once New File Is Created After Backup In Log4CPlus

Greeting

I'm using the Log4CPlus library for logging. I want to log the application version and release date once the new log file is created after backup (DailyRollingFileAppender).

How can I do that?

This is how I configured my appender.

log4cplus.logger.DEVELOPER=DEBUG, Developer
log4cplus.appender.Developer=log4cplus::DailyRollingFileAppender
log4cplus.appender.Developer.DatePattern=%Y-%m-%d
log4cplus.appender.Developer.Schedule=DAILY
log4cplus.appender.Developer.File=logs/Developer.log
log4cplus.appender.Developer.MaxFileSize=2MB
log4cplus.appender.Developer.MaxBackupIndex=200
log4cplus.appender.Developer.layout=log4cplus::PatternLayout
log4cplus.appender.Developer.layout.ContextPrinting=enabled
log4cplus.appender.Developer.layout.ConversionPattern=%D{[%Y/%m/%d %H:%M:%S,%Q]} [%t] %p - %m%n 
log4cplus.appender.Developer.Threshold=TRACE

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire