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. Advertisements

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. Joerg Lensing
    Replies:
    2
    Views:
    24,944
    Simon Niederberger
    Feb 12, 2004
  2. Roger

    Log4j - logger inheritance

    Roger, Jun 10, 2004, in forum: Java
    Replies:
    4
    Views:
    8,928
    GaryM
    Jun 11, 2004
  3. Rodolfo
    Replies:
    0
    Views:
    1,182
    Rodolfo
    Jul 12, 2004
  4. Tony Lockyer

    Java Logger vs Log4J

    Tony Lockyer, Jul 26, 2004, in forum: Java
    Replies:
    1
    Views:
    1,489
  5. sachin
    Replies:
    1
    Views:
    1,151
    Soren Kuula
    Feb 3, 2006
  6. John Smith

    log4j - different logger instances

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