Log4j using different Logger for a class

N

Nicolas

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top