Log4j using different Logger for a class

Discussion in 'Java' started by Nicolas, Sep 8, 2004.

  1. Nicolas

    Nicolas Guest

    Hi,

    I want to define Two ways of logging information in two files.
    One for debug the other for ERROR

    As Anyone try this?

    my properties :

    log4j.logger.application.myClass=INFO,myClass
    log4j.appender.authentification=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.authentification.file=corsaire_web_authentification.log
    log4j.appender.authentification.layout=org.apache.log4j.PatternLayout
    log4j.appender.authentification.DatePattern='.'yyyy_MM_dd
    log4j.appender.authentification.layout.ConversionPattern=%d %-5p [%c]
    %M : (ligne %L) - %m %n

    ######### log for Authentification test NP
    log4j.logger.application.myClass=DEBUG,authentification2
    log4j.appender.authentification2=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.authentification2.file=web_authentification_testNP.log
    log4j.appender.authentification2.layout=org.apache.log4j.PatternLayout
    log4j.appender.authentification2.DatePattern='.'yyyy_MM_dd
    log4j.appender.authentification2.layout.ConversionPattern=%d %-5p [%c]
    %M : (ligne %L) - %m %n
    Nicolas, Sep 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rodolfo
    Replies:
    0
    Views:
    945
    Rodolfo
    Jul 12, 2004
  2. sachin
    Replies:
    1
    Views:
    938
    Soren Kuula
    Feb 3, 2006
  3. John Smith

    log4j - different logger instances

    John Smith, Apr 29, 2010, in forum: Java
    Replies:
    2
    Views:
    3,993
    John Smith
    Apr 30, 2010
  4. cap
    Replies:
    3
    Views:
    270
    James Edward Gray II
    Dec 11, 2005
  5. Georges Ko
    Replies:
    4
    Views:
    256
    Georges Ko
    Jul 26, 2006
Loading...

Share This Page