Hi Ram,

Thanks for the info but i already tried this configuration and it
turns out the logging are the same...

xxx.log content the same with yyy.log

What i like to know is that how will my class determine which log file
to use? If i want to log to xxx.log or yyy.log, how will i point to
this file?


Any ideas, please help.


Thanks,
brendon

-----Original Message-----
From: Ramadoss Chinnakuzhandai
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 12:49 PM
To: Log4J Users List
Subject: RE: log different file



Hi Brendon,
                 Basically if you want to log onto different file
declare different appender both write into different file and these
appenders could be FileAppender or RollingFileAppender or
CompositeFileAppender. 

For example..

log4j.rootCategory=debug, A1, A2
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=xxx.log
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.A1.MaxFileSize=10MB
log4j.appender.A1.MaxBackupIndex=3

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.File=yyy.log
log4j.appender.A2.DatePattern='.'yyyy-MM-dd
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.A2.MaxFileSize=10MB
log4j.appender.A2.MaxBackupIndex=3

There will be a two log file xxx.log and yyy.log.

Hope this helps..

Reg,
Ram



-----Original Message-----
From: Brendon Co [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 7:24 AM
To: Log4J Users List
Subject: log different file


Hi,

How do i log different file?

Below is my current configuration....
======================================================================
===========================

log4j.rootCategory=debug, A1, A2

#### appender writes to a file

log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=xxx.log
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout


#### Should i do it this way?

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.File=xxx.log
log4j.appender.A2.DatePattern='.'yyyy-MM-dd
log4j.appender.A2.layout=org.apache.log4j.PatternLayout


# Control the maximum log file size log4j.appender.A1.MaxFileSize=10MB


# Should i do it this way?
log4j.appender.A2.MaxFileSize=10MB


# Archive log files (one backup file here)
log4j.appender.A1.MaxBackupIndex=3


# Should i do it this way?
log4j.appender.A2.MaxBackupIndex=3

# Note the %x conversion specifier for NDC printing.
#log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] (%x) - %m\n
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

# Should i do it this way?
log4j.appender.A2.layout.ConversionPattern=%d
[%t] %-5p %c - %m%n

======================================================================
===========================


What is the basic way to do it?

Please help...


Thanks,
brendon

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/2003
 

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


**************************Disclaimer**********************************
**

Information contained in this E-MAIL being proprietary to Wipro
Limited is 
'privileged' and 'confidential' and intended for use only by the
individual
 or entity to which it is addressed. You are notified that any use,
copying 
or dissemination of the information contained in the E-MAIL in any
manner 
whatsoever is strictly prohibited.

**********************************************************************
*****

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 5/19/2003
 

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

Reply via email to