Atte A wrote:
> 
> >
> >This problem is about multiple clients logging to two different log files.
> >(One log file for errors and one for tracing)
> >
> >I have two categories and each one of them has its own configuration
> >property file. In both of the configuration property file the file appender
> >is stated.

I don't see two categories.  I only see you using the root category. 
Consider defining two categories like I have done below.  I have
commented out the two category statements and added new ones.

> >MY PROPERTY FILES:
> >FILE 1:
> >
> >#log4j.rootCategory=debug, ErrorAppender
> >log4j.category.errorCat=debug,ErrorAppender
> >
> >log4j.appender.ErrorAppender=org.apache.log4j.RollingFileAppender
> >log4j.appender.ErrorAppender.File=C:\\Nyttja_Error.log
> >
> >log4j.appender.ErrorAppender.MaxFileSize=1000KB
> >log4j.appender.ErrorAppender.MaxBackupIndex=5
> >
> >log4j.appender.ErrorAppender.layout=org.apache.log4j.PatternLayout
> >log4j.appender.ErrorAppender.layout.ConversionPattern=%m%n%n
> >
> >FILE 2:
> >
> >#log4j.rootCategory=debug,TraceAppender
> >log4j.category.traceCat=debug,TraceAppender
> >
> >log4j.appender.TraceAppender=org.apache.log4j.RollingFileAppender
> >log4j.appender.TraceAppender.File=C:\\Nyttja_Trace.log
> >
> >log4j.appender.TraceAppender.MaxFileSize=1000KB
> >log4j.appender.TraceAppender.MaxBackupIndex=5
> >
> >log4j.appender.TraceAppender.layout=org.apache.log4j.PatternLayout
> 
>>log4j.appender.TraceAppender.layout.ConversionPattern=Time:%d{HH:mm:ss.SSS}%nClass:%c%nMethod:%m%nThread:%t%n%n

To pick these up in your code, you need statements like the following:

Category err = Category.getInstance("errorCat");
Category trc = Category.getInstance("traceCat");

And then your off to the races.

-- 
Beware of bugs in the above code.  I have
only proved it correct, not tried it.
-Don Knuth

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

Reply via email to