Reputation: 2861
I recently figured out how to output log4cplus messages in a format compatible with LogFactor5 in my C++ application:
In my log4cplus.properties file I have the following appender defined:
# LogFactor5 appender
log4cplus.appender.LogFactor5=log4cplus::RollingFileAppender
log4cplus.appender.LogFactor5.Schedule=DAILY
log4cplus.appender.LogFactor5.File=/home/ken/logs/project1.logfactor5
log4cplus.appender.LogFactor5.Append=true
log4cplus.appender.LogFactor5.MaxBackupIndex=9
log4cplus.appender.LogFactor5.MaxFileSize=100KB
log4cplus.appender.LogFactor5.layout=log4cplus::PatternLayout
log4cplus.appender.LogFactor5.layout.ConversionPattern=[slf5s.start]%d{%d %b %Y %H:%M:%S,%Q}[slf5s.DATE]%n%p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n
However, I would like to do something similar for Chainsaw but have not found the correct format. What is the log message format required by Chainsaw?
Does Chainsaw expect the log messages to be an XML format? Does log4cplus provide XML appenders?
Thanks.
Upvotes: 3
Views: 1026
Reputation: 18228
Log4cplus has grown Log4jUdpAppender in version 1.1.0. Test it.
At this point Log4cplus does not provide any XML appenders. I am certainly open to suggestions how such appender should behave. Please point me at some specification of Chainsaw compatible XML log file.
EDIT1:
log4cplus.properties example:
log4cplus.appender.TEST=log4cplus::Log4jUdpAppender
log4cplus.appender.TEST.host=localhost
log4cplus.appender.TEST.port=4445
Upvotes: 2
Reputation: 1736
Chainsaw V2 can parse and tail regular text files generated by any logging framework, so you aren't required to generate XML-formatted logs.
I'd suggest trying the developer snapshot, at http://people.apache.org/~sdeboy (run the chainsaw/chainsaw.bat file in the zip, or the Mac app from the DMG), and walk through the configuration dialog to define the log format of your log file.
Feel free to send an email to sdeboy at my apache.org address or post a question on the log4j user list if you have further questions.
Upvotes: 2