0

I'm using Log4j in my application and application logging is working fine while framework in my application is internally using commons-logging and logs are going to System.out but I want to redirect them to a separate file and also want to enable DEBUG level.

Tested this on tomcat and working fine. Generating all logs in their respective files. But when I deploy code on WAS7.0, only INFO level of framework logs are being generated SystemOut.log. (my log4j.xml is fine as it is working fine on tomcat)

Any help would be appreciated. Thanks!

HashimR
  • 3,803
  • 8
  • 32
  • 49
  • Possible duplicate of http://stackoverflow.com/questions/8131529/websphere-all-logs-are-going-to-systemout-log/ ? – dbreaux Feb 28 '13 at 14:43
  • @dbreaux already tried it. not working! – HashimR Mar 01 '13 at 04:06
  • Is slf4j in use by any chance? – dbreaux Mar 01 '13 at 14:09
  • I also tried to use `slf4j` but it didn't work out... – HashimR Mar 04 '13 at 04:12
  • I'm just saying that if any of the libs use slf4j, you might also need the jcl-over-slf4j.jar to get those log items also out of SystemOut. http://www.slf4j.org/legacy.html – dbreaux Mar 04 '13 at 15:45
  • Yes I've already tried using jcl-over-slf4j and slf4j-log4j12, logs did move out from the `System.out` but `log4j.xml` was somehow not being read. Can there be any conflict between frameworks logging API and `log4j` as framework is using `Logback`? – HashimR Mar 05 '13 at 04:27

1 Answers1

1

I was having the same problem. I found the answer in Websphere Docs.

Note: Trace information, which includes events at the Fine, Finer and Finest levels, can be written only to the trace log. Therefore, if you do not enable diagnostic trace, setting the log detail level to Fine, Finer, or Finest does not effect the logged data.

Reference: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Frtrb_loglevels.html

In Java Utility Logging terms FINE = DEBUG, so DEBUG level and below will not appear in System.out, only int the WAS trace log.

lsiu
  • 2,297
  • 1
  • 17
  • 20