logo       

RE: Using more than one logger: msg#00003

Subject: RE: Using more than one logger
Hi,
 
I removed asterics and tested, but it doesnt seem to work.
 
Config:
-----------
 
log4j.rootLogger=DEBUG
log4j.logger.sysmonLogger=DEBUG, myappender
 
log4j.additivity.sysmonLogger=false
log4j.appender.myappender=org.apache.log4j.RollingFileAppender
log4j.appender.myappender.File=../logs/sysmon.log
 
log4j.appender.myappender.MaxFileSize=100KB
log4j.appender.myappender.MaxBackupIndex=1
 
log4j.appender.myappender.layout=org.apache.log4j.PatternLayout
Program:
---------------
                PropertyConfigurator::configure(LOG4CXX_FILE("temp.properties"));
                LoggerPtr rootLogger = Logger::getRootLogger();
                LoggerPtr logger = Logger::getLogger("sysmonLogger");
 
                //LOG4CXX_INFO(logger,"info into R");
                LOG4CXX_INFO(logger, "info message");
                LOG4CXX_WARN(logger, "warn message");
                LOG4CXX_ERROR(logger, "error message");
In above program, i tried both
LoggerPtr logger = Logger::getLogger("sysmonLogger");  --> in this case, it didnt print any error while debugging with gdb
and
LoggerPtr logger = Logger::getLogger("sysmon"); ---> this given "log4cxx: No appender could be found for logger (sysmon)"
 
Please help me out
 
And also i am looking for a complete example (program and properties file) for XMLSocketAppender, please send if any of you have.
 
Thnx a lot,
Sandeep


From: Curt Arnold [mailto:carnold@xxxxxxxxxx]
Sent: Monday, April 02, 2007 9:45 PM
To: Log4CXX User
Subject: Re: Using more than one logger


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.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe