logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narasimha.Na...@kp.org
Subject Re: Log4j problem with Rolling file appender!
Date Tue, 02 Mar 2004 22:57:39 GMT
Pradeep, Thanks a lot for your quick response. I am getting this problem 
in production which runs on AIX. I don't think so it is OS specific.  And, 
it is not happening always. The application is running since 2 years. I 
have seems these two problems only couple of times. I guess, it is 
happening in a particular scenario and couldn't figure that. Thanks.





"Pradeep Kanwar" <pkanwar@secf.com>
03/02/2004 02:38 PM
Please respond to "Log4J Users List"

 
        To:     "Log4J Users List" <log4j-user@logging.apache.org>
        cc: 
        Subject:        Re: Log4j problem with Rolling file appender!


Hi Naidu,
 You code runs fine on a standalone app on win2k m/c with log4j-1.2.8. It
has to be something with your webapp/websphere setting.

-pradeep kanwar
ps: your properties file with a basic prog
*******BasicReadFileProperties.properties**********
log4j.category.sca.kpol=ERROR, HL7_APPENDER_SCA
log4j.additivity.sca.kpol=false
log4j.appender.HL7_APPENDER_SCA=org.apache.log4j.RollingFileAppender
log4j.appender.HL7_APPENDER_SCA.File=hl7_rxrefill_sca.log
log4j.appender.HL7_APPENDER_SCA.MaxFileSize=10KB
log4j.appender.HL7_APPENDER_SCA.MaxBackupIndex=1
log4j.appender.HL7_APPENDER_SCA.layout=org.apache.log4j.PatternLayout
log4j.appender.HL7_APPENDER_SCA.layout.ConversionPattern=%d{ISO8601} %-5p
- %m%n
*****BasicReadFileProperties.java************
import org.apache.log4j.Logger;

import org.apache.log4j.PropertyConfigurator;

/**

* @author pkanwar@secf.com

* Mar 2, 2004

* TODO: put class desc here

*/

public class BasicReadPropertyFile {

public void logTest(){

System.out.println("log testing starts....");


//read properties

PropertyConfigurator.configure("C:\\projects\\lab\\BasicReadPropertyFile.pro
perties");

//create logger instance

//Logger l = Logger.getLogger("BasicReadPropertyFile.class");

Logger l = Logger.getLogger("sca.kpol");


//log data

for(int i=0; i<10000 ;i++){


l.debug("debug");

l.info("info");

l.warn("warn");

l.error("error");

l.fatal("fatal");

}

}

public static void main(String[] args) {

BasicReadPropertyFile brpf = new BasicReadPropertyFile();

brpf.logTest();

}

}

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

----- Original Message ----- 
From: <Narasimha.Naidu@kp.org>
To: <log4j-user@jakarta.apache.org>
Sent: Tuesday, March 02, 2004 12:58 PM
Subject: Re: Log4j problem with Rolling file appender!


> Hi,
>
> We are currently using log4j-1.2.7 and deployed as a web application in
> WebSphere
> application server. The setting for the Rolling File Appender is
>
> log4j.category.sca.kpol=ERROR, HL7_APPENDER_SCA
> log4j.additivity.sca.kpol=false
> log4j.appender.HL7_APPENDER_SCA=org.apache.log4j.RollingFileAppender
>
log4j.appender.HL7_APPENDER_SCA.File=/logs/kporg/rxrefill/hl7_rxrefill_sca.l
og
> log4j.appender.HL7_APPENDER_SCA.MaxFileSize=100KB
> log4j.appender.HL7_APPENDER_SCA.MaxBackupIndex=1
> log4j.appender.HL7_APPENDER_SCA.layout=org.apache.log4j.PatternLayout
> log4j.appender.HL7_APPENDER_SCA.layout.ConversionPattern=%d{ISO8601} 
%-5p
> - %m%n
>
> I am getting the following errors with this current setting, with the
> log4j backup file.
>
> 1. Wiping out the backup file: After log4j has taken the backup when the
> size is reached over 100KB, the size of hl7_rxrefill_sca.log.1 is 0KB.
> This is not happening always. But, I can't figure out the reason why it 
is
> wiping out the contents.
> 2. Another weird behavior. Log4j is updating both the original file and
> back up file simultaneously once the back up has taken.
>
> Appreciate you help.
> Naidu
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message