Hi , 

log4j.rootCategory=INFO , A1, A2

in here , there is only one root category and two appenders A1,and A2 
if you want to make your own categories try this in your properties file
like that : 

log4j.category.deneme=INFO, logx
log4j.additivity.deneme=false
log4j.appender.logx=org.apache.log4j.RollingFileAppender 
log4j.appender.logx.File=/tmp/test.log 
log4j.appender.logx.layout.ConversionPattern=%-25d %p %-40.40c{1} %3x - %m%n

log4j.appender.logx.layout=org.apache.log4j.PatternLayout 
log4j.appender.logx.MaxFileSize=10MB 
log4j.appender.logx.MaxBackupIndex=1 

log4j.category.deneme2=DEBUG, logy
log4j.additivity.deneme2=false
log4j.appender.logy=org.apache.log4j.RollingFileAppender 
log4j.appender.logy.File=/tmp/bireysel.log 
log4j.appender.logy.layout.ConversionPattern=%-25d %p %-40.40c{1} %3x - %m%n

log4j.appender.logy.layout=org.apache.log4j.PatternLayout 
log4j.appender.logy.MaxFileSize=10MB 
log4j.appender.logy.MaxBackupIndex=1 


deneme , deneme2 are  two categories 

if you want to use them in your java beans or somewhere , try like that  : 

static Category cat = Category.getInstance("deneme");  




Regards

Altug





-----Original Message-----
From: Naresh Sharma [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 6:18 AM
To: log4j mailing list
Subject: Categories concept


Hello Everybody,


Well my understanding about Category is that we can have our own
categories and there must be category declared in the properties file,
for which we can call like this

        static Category CAT =
Category.getInstance(Sort.class.getName());

in this case their should be a category with fully qualified name of
Sort class declared in Properties file.

Now when i looked in to the example code in which property file  have
following as the root directory value

    log4j.rootCategory=, A1, A2

and still in the code we can use this command.

    static Category CAT = Category.getInstance(Sort.class.getName());

Now my question is that how this is returning the category with fully
qualified name of the sort class.

I guess i am missing something, please let me know and if publish sample
property file for defining custom property file, if possible.


Thanks a lot
Naresh




_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com




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