Sign in to follow this  
junjunyu

log4cpp and kiwi remote logging

Recommended Posts

Does any one know how to send logging message from log4cpp to a remote listener.
Kiwi is on windows and seems not to have any problems, I tested it by telnet in linux server. My program also output my logging message on my screen.
The followings are from log4cpp.conf:
log4cpp.category.initialize= DEBUG, initialize
log4cpp.appender.initialize=SyslogAppender
log4cpp.appender.initialize.syslogName="initialize"
log4cpp.appender.initialize.syslogHost=x.x.x.x
log4cpp.appender.initialize.portNumber=1468
log4cpp.appender.initialize.facility=7
log4cpp.appender.initialize.layout=PatternLayout
log4cpp.appender.initialize.layout.ConversionPattern=[%p] - %m%n

Codes:
try
{
log4cpp::PropertyConfigurator::configure ( "./log4cpp.conf" );
}
catch ( log4cpp::ConfigureFailure& f )
{
return -1;
}
log4cpp::Category& log=log4cpp::Category::getInstance(std::string("initialize"));
log.info("any");

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this