Menu

Logging to multiple file appenders based

Help
2008-03-15
2013-04-09
  • Nobody/Anonymous

    Now i know this should be simple but i cant make it work.

    # ConsoleAppender, File
    log4j.rootLogger=, A1, A2
    log4j.logger.log4plsql.LOG_PIPE.APEX_PUBLIC_USER.3PL_RECONCILE=DEBUG, A3

    A1 is the console appender

    log4j.appender.A2=org.apache.log4j.RollingFileAppender
    log4j.appender.A2.File=/export/home/oracle/sfw/Log4plsql/log/test2.log
    log4j.appender.A2.MaxFileSize=8192KB
    log4j.appender.A2.MaxBackupIndex=10

    # Truncate 'log4plsql.log' if it aleady exists.
    #log4j.appender.A2.Append=false
    log4j.appender.A2.Append=true

    # Appender A2 uses the PatternLayout.
    log4j.appender.A2.layout=org.apache.log4j.PatternLayout

    # standard information
    #log4j.appender.A2.layout.ConversionPattern=%d %-5p (%c) - %m [%x]%n
    log4j.appender.A2.layout.ConversionPattern=%d %-5p (%c) - %m %n

    log4j.appender.A3=org.apache.log4j.RollingFileAppender
    log4j.appender.A3.File=/export/home/oracle/sfw/Log4plsql/log/3PL.log
    log4j.appender.A3.MaxFileSize=8192KB
    log4j.appender.A3.MaxBackupIndex=10
    log4j.appender.A3.Threshold=WARN

    # Truncate 'log4plsql.log' if it aleady exists.
    #log4j.appender.A3.Append=false
    log4j.appender.A3.Append=true

    # Appender A3 uses the PatternLayout.
    log4j.appender.A3.layout=org.apache.log4j.PatternLayout

    # standard information
    #log4j.appender.A3.layout.ConversionPattern=%d %-5p (%c) - %m [%x]%n
    log4j.appender.A3.layout.ConversionPattern=%p,%m%n

    All content goes to test2.log and none to 3PL.log

    Even though there are entries in test2.log which indicate that the logging class should also log to 3PL.log
    For example:-
    2008-03-15 23:17:03,322 INFO  (log4plsql.LOG_PIPE.APEX_PUBLIC_USER.3PL_RECONCILE) - Starting download_file for file (1058908395516209)

    Any ideas??

    Thanks in advance Simon

     
    • Nobody/Anonymous

      Hi,
      You can try by changing the apender level to INFO for A3.

      Change this :
      log4j.appender.A3.Threshold=WARN

      to
      log4j.appender.A3.Threshold=INFO

      All the best

       

Log in to post a comment.

MongoDB Logo MongoDB