On Apr 1, 2007, at 10:44 AM, Rayapudi Sandeep-mgb376 wrote:
Hi,
I am a newbie to Log4cxx and
I am trying to use more than one logger, and searched through
mailing list but solution given doesn’t seem to work.
Please look at my code and config file and reply me where I am
doing it wrong
Code:
-----
PropertyConfigurator::configure(LOG4CXX_FILE(pbConfigFile));
LoggerPtr rootLogger = Logger::getRootLogger(); logger =
Logger::getLogger("sysmonLogger");
LOG4CXX_INFO(logger, "********************* LOG OPEN
*********************\n");
-- While I debug above code, this is the error message I got
log4cxx: No appender could be found for logger (sysmonLogger).
log4cxx: Please initialize the log4cxx system properly.
Config:
-------
log4j.rootLogger=DEBUG
log4j.*logger.*sysmonLogger=DEBUG, myappender
Why do you have asterisks (*) in the previous line? I have not seen
that documented and don't know of any code that supports wildcarding
in the properties file. Unless I'm missing something, that line
would not be recognized by the PropertyConfigurator which would
result in having no appender for the sysmonLogger as indicated by the
diagnostic message. Remove the asterisks and report what happens.