Re: Problem to load log4j.dtd
we use log4j in a production environment and it's not easy to change my version of log4j. Is there a bug with the 1.2.4 version that can explain my problem ? In the line !DOCTYPE log4j:configuration SYSTEM log4j.dtd what the word SYSTEM means ? Can I specify where is my log4j.dtd file ? Thanks for your help Xavier [EMAIL PROTECTED] wrote: Have you tried using 1.2.8? At 07:54 PM 5/27/2003 +0200, you wrote: my version of log4j is 1.2.4 Xavier -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Xavier, Which version of log4j are you using? At 06:37 PM 5/27/2003 +0200, you wrote: Hi, I use apache 2 and tomcat 4.1 and I want to start a web app that use log4j to log. My log4j.xml file is in my $CATALINA_BASE/conf directory and this directory is in my CLASSPATH. My log4j.dtd is also in $CATALINA_BASE/conf. In the log4j.xml file, I specify: !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; At the startup, tomcat find my log4j.xml file (as I can see in the catalina.out log), but the URL it uses for the log4j.dtd file is: jar:file:/opt/hpws/tomcat/common/lib/log4j-1.2.4.jar!/org/apache/log4j/xml/log4j.dtd Why does-it use this URL ? How can I indicate where is my log4j.dtd file ? Thank you for your help Xavier -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - 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]
log4j.properties file Location
Dear All, Shall I placed my log4j.properties file in web-inf/classes/properties folder structure instead of web-inf/classes How the system identifies these properties files ? Thanks Regards, Ashok.D - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem to load log4j.dtd
Log4j-1.2.8 introduced a better entity resolving mechanism and should clear up the problem. There were bugs in previous versions. The change shouldn't do much other than fix your issue. Test first, of course. Jake At 04:07 PM 5/28/2003 +0200, you wrote: we use log4j in a production environment and it's not easy to change my version of log4j. Is there a bug with the 1.2.4 version that can explain my problem ? In the line !DOCTYPE log4j:configuration SYSTEM log4j.dtd what the word SYSTEM means ? Can I specify where is my log4j.dtd file ? Thanks for your help Xavier [EMAIL PROTECTED] wrote: Have you tried using 1.2.8? At 07:54 PM 5/27/2003 +0200, you wrote: my version of log4j is 1.2.4 Xavier -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Xavier, Which version of log4j are you using? At 06:37 PM 5/27/2003 +0200, you wrote: Hi, I use apache 2 and tomcat 4.1 and I want to start a web app that use log4j to log. My log4j.xml file is in my $CATALINA_BASE/conf directory and this directory is in my CLASSPATH. My log4j.dtd is also in $CATALINA_BASE/conf. In the log4j.xml file, I specify: !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; At the startup, tomcat find my log4j.xml file (as I can see in the catalina.out log), but the URL it uses for the log4j.dtd file is: jar:file:/opt/hpws/tomcat/common/lib/log4j-1.2.4.jar!/org/apache/log4j/ xml/log4j.dtd Why does-it use this URL ? How can I indicate where is my log4j.dtd file ? Thank you for your help Xavier -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - 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]
SMTPAppender usage
I am trying to use the SMTPAppender to a simple java program and get the following error on the console, Exception in thread main java.lang.NoClassDefFoundError: javax/mail/Multipart at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590) at java.lang.Class.getConstructor0(Class.java:1762) at java.lang.Class.newInstance0(Class.java:276) at java.lang.Class.newInstance(Class.java:259) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(Optio nConverter.java:319) at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConve rter.java:112) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigura tor.java:620) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigura tor.java:603) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyC onfigurator.java:500) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato r.java:406) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato r.java:307) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator. java:315) at CoolLog.main(CoolLog.java:14) The property file entry I have is as follows, log4j.appender.email=org.apache.log4j.net.SMTPAppender log4j.appender.email.threshold=ERROR log4j.appender.email.SMTPHost=smtp.somedomain.com log4j.appender.email.BufferSize=1 log4j.appender.email.user=your username log4j.appender.email.password=your password log4j.appender.email.subject=Whatever subject log4j.appender.email.from=[EMAIL PROTECTED] log4j.appender.email.to=[EMAIL PROTECTED] log4j.appender.email.layout=org.apache.log4j.PatternLayout log4j.appender.email.layout.ConversionPattern=%dISO8601 %5p [%t] (%F:%L) - %m%n The program that I have the is a HelloWorld with all of the levels being printed and works fine for ConsoleAppender and RollingFileAppender formats. JDK Verison is 1.4_02 Any pointers will be appreciated Sree
RE: SMTPAppender usage
Howdy, Do you have the JavaMail API (mail.jar) and Java Activation Framework (activation.jar) on your classpath? If not, download them from java.sun.com and add them. Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 11:32 AM To: [EMAIL PROTECTED] Subject: SMTPAppender usage I am trying to use the SMTPAppender to a simple java program and get the following error on the console, Exception in thread main java.lang.NoClassDefFoundError: javax/mail/Multipart at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590) at java.lang.Class.getConstructor0(Class.java:1762) at java.lang.Class.newInstance0(Class.java:276) at java.lang.Class.newInstance(Class.java:259) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(Optio nConverter.java:319) at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConve rter.java:112) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigura tor.java:620) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigura tor.java:603) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyC onfigurator.java:500) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato r.java:406) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurato r.java:307) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator. java:315) at CoolLog.main(CoolLog.java:14) The property file entry I have is as follows, log4j.appender.email=org.apache.log4j.net.SMTPAppender log4j.appender.email.threshold=ERROR log4j.appender.email.SMTPHost=smtp.somedomain.com log4j.appender.email.BufferSize=1 log4j.appender.email.user=your username log4j.appender.email.password=your password log4j.appender.email.subject=Whatever subject log4j.appender.email.from=[EMAIL PROTECTED] log4j.appender.email.to=[EMAIL PROTECTED] log4j.appender.email.layout=org.apache.log4j.PatternLayout log4j.appender.email.layout.ConversionPattern=%dISO8601 %5p [%t] (%F:%L) - %m%n The program that I have the is a HelloWorld with all of the levels being printed and works fine for ConsoleAppender and RollingFileAppender formats. JDK Verison is 1.4_02 Any pointers will be appreciated Sree This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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='.'-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='.'-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]
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='.'-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='.'-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='.'-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='.'-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]
RE: log different file
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='.'-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='.'-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='.'-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='.'-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]
RE: log different file
Hi Brendon, I suppose if you(program)want to decide which file to log then you could probably define property/xml file and configure it explicitly since default log4j.properties/xml will write the same contents onto both files(xxx.log,yyy.log)irrespective of which one to chose and write. Since you are loading it explicitly you can define which file to write. HTH, Ram -Original Message- From: Brendon Co [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 10:36 AM To: Log4J Users List Subject: RE: log different file 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='.'-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='.'-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='.'-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='.'-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
RE: log different file
There are a couple of ways to control which logging events go into certain files (more specifically, certain appenders). You could specify named Loggers with package or class names in your log4j config file such that output from certain packages or classes are printed to separate files. You could also extend the Filter class and attach filters to your appenders in your config file so that logging events are routed to separate appenders / files depending on content, level... the possibilities are endless with this approach. We've been using custom filter classes to distribute log output to several files based on NDC and MDC values. I was pleasantly surprised to see similar ones added to the log4j-sandbox in recent months. -Scott Heaberlin -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 2:47 AM To: Log4J Users List Subject: RE: log different file Hi Brendon, I suppose if you(program)want to decide which file to log then you could probably define property/xml file and configure it explicitly since default log4j.properties/xml will write the same contents onto both files(xxx.log,yyy.log)irrespective of which one to chose and write. Since you are loading it explicitly you can define which file to write. HTH, Ram -Original Message- From: Brendon Co [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 10:36 AM To: Log4J Users List Subject: RE: log different file 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='.'-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='.'-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='.'-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='.'-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
FileAppender
Greetings, When setting up a file appender, the docs say that if the file doesn't exist, it is created. This is true, with the following caveat: if one or more of the directories do not exist, the file is not created. This causes problems if I want to setup a new server to log to a log directory that hasn't been created yet. It adds administrative complexity to require the deployer to know that the directory needs to be created. The code should be smart enough to do this. Does anyone know if more recent releases of log4j have fixed this? If not, can this enhancment be made (or should I make it myself)? All you really need to do is a File.createDirs() in FileAppender.setFile(...). Charles Hudak Software Engineering Manager Arrowhead General Insurance/YouZoom, Inc. [EMAIL PROTECTED] 858.320.6800x6344 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]