Log4j not logging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eazyigz
    New Member
    • Sep 2008
    • 6

    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.
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    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:-)
    Last edited by Dököll; Jan 6 '09, 12:32 AM. Reason: modified text...

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by eazyigz
      Nothing is working! My application is not logging out anything.
      You must've misconfigured the logging framework or you haven't configured it at all; read the short manual.

      kind regards,

      Jos

      Comment

      • eazyigz
        New Member
        • Sep 2008
        • 6

        #4
        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.

        Code:
        log4j.debug = true
        log4j.rootLogger=OFF
        log4j.logger.com.iso.wc.fst=ERROR
        log4j.logger.com.iso.framework=ERROR, FFILE, FSNMP
        #################################### end of root and framework logger setting  #####################################
        log4j.appender.FFILE=com.iso.framework.logging.ISOWebDailyRollingFileAppender
        log4j.appender.FFILE.Directory=wdilogs
        log4j.appender.FFILE.LogFile=FSTWebISOFramework.log
        log4j.appender.FFILE.DatePattern='.'yyyy-MM-dd
        log4j.appender.FFILE.layout=org.apache.log4j.PatternLayout
        log4j.appender.FFILE.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
        
        log4j.appender.FSNMP=com.iso.framework.logging.SNMPAppender
        log4j.appender.FSNMP.threshold=ERROR
        log4j.appender.FSNMP.layout=org.apache.log4j.PatternLayout
        log4j.appender.FSNMP.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
        log4j.additivity.com.iso.framework=false
        #################################### 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.co m.iso.wc.fst and log4j.logger.co m.iso.framework. How does this hierarchy work?

        Thank you!

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          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?

          Comment

          • eazyigz
            New Member
            • Sep 2008
            • 6

            #6
            When I say multiple logging levels I mean specifying ERROR, DEBUG, TRACE, etc. all at once.

            Comment

            Working...