Log4j message Problem


Web tier: servlets, JSP, Web frameworks: Log4j message Problem

  1. Log4j message Problem (5 messages)

    Problem description: my logger.info statements from my classes are logged in app.log as well as System.out (Websphere) where as i am expecting it to see only in app.log ? Is thereanything i am missing here !!! I am loading log4j. properties using the following line in one of my classes ... PropertyConfigurator.configure(/usr/log/log4j.properties); Log4j.properties log4j.rootLogger=ERROR # Specify where to log by packages. log4j.logger.com.abc.example=INFO,dest1 log4j.appender.dest1=org.apache.log4j.RollingFileAppender log4j.appender.dest1.File=app.log log4j.appender.dest1.MaxFileSize=10000KB log4j.appender.dest1.MaxBackupIndex=30 log4j.appender.dest1.layout=org.apache.log4j.PatternLayout #log4j.appender.stdout=org.apache.log4j.ConsoleAppender #log4j.appender.stdout.Target=System.out #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout #log4j.appender.sdtout.Threshold=ERROR Please help. Thanks.

    Threaded Messages (5)

  2. I hope you have not used System.out statements in your code. Looking at your properties file, I can see no reason why your log statements will be printed in System.out. Make sure there is no other log4j.properties file lying in your server classpath. You can verify this by deleting this current file and see if logging still works.
  3. Something that might be helpful is to enable log4j debugging. put this as the first line in your log4j.properties log4j.debug=true Then loog4j will print out information about how it has been configured.
  4. I don't see there is any problem, only that I have a question, why is the rootlogger is set as ErroR , not INFO? thanks, http://context2designpatterns.googlepages.com
  5. AFAIK, writing to app.log can be controlled by log4j, but SysOut.log can be switched ON/OFF by websphere settings (?)
  6. Re: Log4j message Problem[ Go to top ]

    Having the same problem, did you get it fixed?