I've tried a config file like this one and then I've added another
logger like this:

log4j.rootCategory = DEBUG, LogFile, LogFile2

log4j.appender.LogFile = org.apache.log4j.FileAppender
log4j.appender.LogFile2 = org.apache.log4j.FileAppender

log4j.appender.LogFile.layout = org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern = %d{dd.MM.yyyy
HH:mm:ss} %-5p: [%m] -> %c%n
log4j.appender.LogFile2.layout = org.apache.log4j.PatternLayout
log4j.appender.LogFile2.layout.ConversionPattern = %d{dd.MM.yyyy
HH:mm:ss} %-5p: [%m] -> %c%n


log4j.appender.LogFile.File = C:\\Temp\\TestLog.log
log4j.appender.LogFile2.File = C:\\Temp\\TestLog2.log

but then, when I log to LogFile, it writes to both file and if I write
to LogFile2 it does the same. How do you setup N (i.e. more than 1)
independant logger in the same config file ?


-----Original Message-----
From: Nicole Grübel [mailto:[EMAIL PROTECTED]]
Sent: vendredi, 8. mars 2002 14:48
To: [EMAIL PROTECTED]
Subject: Re: I am unable to log the messages to a file


I'm not sure if this is helpful, but this way I told my Config-File to
log messages to a file. It's nearly the same when you use XML and it
might give you an idea what you should implement in your source-code if
you don't use a configuration file.

log4j.rootCategory = DEBUG, LogFile

log4j.appender.LogFile = org.apache.log4j.FileAppender

log4j.appender.LogFile.layout = org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern = %d{dd.MM.yyyy
HH:mm:ss} %-5p: [%m] -> %c%n

log4j.appender.LogFile.File = C:\\Temp\\TestLog.log


I hope this helps. 

Nicole 
________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to