In your properties file (or XML config file) you will want to create two
appenders (FileAppender, since you want to log to a file) say XxxFile and
ZzzFile.

You will then attach each appender to a category, typically categories
equate with packages. 

Example:

log4j.appender.XxxFile=org.apache.log4j.FileAppender
log4j.appender.XxxFile.File=c:\logs\MyXxxFile.log
log4j.appender.XxxFile.layout=org.apache.log4j.PatternLayout
log4j.appender.XxxFile.layout.ConversionPattern=%r\t[%t]\t%p\t%c\t[%x]\t%m%n
log4j.category.aaa.bbb.xxx=DEBUG, XxxFile

Cheers
John Volkar

PS: Read the manual, it's all in there!


-----Original Message-----
From: Welp, Norman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 7:13 AM
To: '[EMAIL PROTECTED]'
Subject: Logging configuration


Hello.

I'm kind of new to log4j, so my question could be newbie-like, sorry.

I want to be able to define explicitly that logging should be done only if
it occurs in a certain package.

For example:

A package "aaa.bbb" is devided into packages "aaa.bbb.xxx" and
"aaa.bbb.zzz".

Now i'd like to put the logging for "aaa.bbb.xxx"  into a file and for
"aaa.bbb.zzz" into another one. 

Anyone ?

Thanks for your time,


Norman. 

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

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

Reply via email to