467,895 Members | 1,440 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,895 developers. It's quick & easy.

Log4j not logging

Hi,
I have played with various settings in the log4j properties file. I've tried different logging levels also. Nothing is working! My application is not logging out anything.
Jan 5 '09 #1
  • viewed: 7676
Share:
5 Replies
Dököll
Expert 2GB
If you ahve previously searched here for an answer... Try the sun site yet on this, couldn't hurt...

Care to also post your code:-)
Jan 6 '09 #2
Expert 8TB
@eazyigz
You must've misconfigured the logging framework or you haven't configured it at all; read the short manual.

kind regards,

Jos
Jan 6 '09 #3
Ok, I managed to get it logging by playing around with values in the properties file. The original settings were as follows. Where it says ERROR, I added DEBUG and INFO.

Expand|Select|Wrap|Line Numbers
  1. log4j.debug = true
  2. log4j.rootLogger=OFF
  3. log4j.logger.com.iso.wc.fst=ERROR
  4. log4j.logger.com.iso.framework=ERROR, FFILE, FSNMP
  5. #################################### end of root and framework logger setting  #####################################
  6. log4j.appender.FFILE=com.iso.framework.logging.ISOWebDailyRollingFileAppender
  7. log4j.appender.FFILE.Directory=wdilogs
  8. log4j.appender.FFILE.LogFile=FSTWebISOFramework.log
  9. log4j.appender.FFILE.DatePattern='.'yyyy-MM-dd
  10. log4j.appender.FFILE.layout=org.apache.log4j.PatternLayout
  11. log4j.appender.FFILE.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
  12.  
  13. log4j.appender.FSNMP=com.iso.framework.logging.SNMPAppender
  14. log4j.appender.FSNMP.threshold=ERROR
  15. log4j.appender.FSNMP.layout=org.apache.log4j.PatternLayout
  16. log4j.appender.FSNMP.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
  17. log4j.additivity.com.iso.framework=false
  18. #################################### end of framework appenders #####################################
My question is this: is it allowed to specify multiple logging levels at once? Also, I'm trying to understand the package hierarchy with respect to log4j.logger.com.iso.wc.fst and log4j.logger.com.iso.framework. How does this hierarchy work?

Thank you!
Jan 7 '09 #4
jkmyoung
Expert 2GB
When you say specify multiple logging levels, do you mean for the specific message? Generally, if you are outputting WARN messages you're also outputting ERROR messages as well, so you can just put the output level to ERROR in this case. You can also just have multiple output statements for different log levels.

or do you mean something else entirely?
Jan 7 '09 #5
When I say multiple logging levels I mean specifying ERROR, DEBUG, TRACE, etc. all at once.
Jan 8 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Aaron Boxer | last post: by
2 posts views Thread by Greg Scharlemann | last post: by
4 posts views Thread by Jan van Mansum | last post: by
2 posts views Thread by BobReynolds | last post: by
5 posts views Thread by Ravi Shankar | last post: by
3 posts views Thread by Irmen de Jong | last post: by
23 posts views Thread by Rotem | last post: by
10 posts views Thread by Baurzhan Ismagulov | last post: by
1 post views Thread by Kedar Kachare | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.