|
From: Steve H. <sha...@mi...> - 2014-01-28 22:31:49
|
Hello all,
I have recently run into a situation in which it would have been really convenient if the file appenders had some way to add a header line to the top of each file. I don't mind doing the coding for this, but first wanted to throw the idea out there to see if someone else may have a better idea for implementation.
My plan was to simply add an attribute to the file appenders named something like "FileHeader" which would contain a string. That string would be inserted as the first line in each file. For example:
log4cplus.temperatureLogger=DEBUG, A2
log4cplus.appender.A2=log4cplus::DailyRollingFileAppender
log4cplus.appender.A2.File=log/temperature
log4cplus.appender.A2.layout=log4cplus::PatternLayout
log4cplus.appender.A2.Schedule=DAILY
log4cplus.appender.A2.MaxBackupIndex=2
log4cplus.appender.A2.FileHeader=Date Temperature1 Setpoint1 Temperature2 Setpoint2%n
log4cplus.appender.A2.layout.ConversionPattern=%D{%Y-%m-%d %H:%M:%S.%q} %m%n
Or should this be implemented in the layout?
Thoughts?
Regards,
Steven Hartmann
|