dcsimg
Log4j won't create backups...please help!
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bodny_Olivince
Posted On:   Friday, June 20, 2003 10:33 AM

Hi there, I am fairly new in web application development where I am using log4j for logging purposes. I've encountered a problem I am not sure how to solve. I set a property file (see below) where I indicate that 3 backup logs are to be kept. It creates the first log properly. However, it overwrites the file instead of creating a new one each time the size limit is met. I can't figure out why this is hapening. Please take a look at my file and try to figure what's causing the overwrite as oppose to creating the specified number of backups. Thanks Bodny log4j.rootLogger=debug, stdout, R log4j.appender.stdout=org.apache.log4j.ConsoleAppende   More>>

Hi there,
I am fairly new in web application development where I am using
log4j for logging purposes. I've encountered a problem I am not sure how
to solve.
I set a property file (see below) where I indicate that 3 backup logs are
to be kept. It creates the first log properly. However, it overwrites the
file instead of creating a new one each time the size limit is met. I
can't figure out why this is hapening. Please take a look at my file and
try to figure what's causing the overwrite as oppose to creating the
specified number of backups. Thanks

Bodny


log4j.rootLogger=debug, stdout, R


log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout


# Pattern to output the caller's file name and line number.

# log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n


log4j.appender.stdout.layout.ConversionPattern
=[slf5s.start]%d{DATE}[slf5s.DATE]%n
%p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n
%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n



log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=WEB-INF/logs/log4j.log

#log4j.appender.R.Append=true



log4j.appender.R.layout=org.apache.log4j.PatternLayout

# log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n


log4j.appender.R.layout.ConversionPattern=%d{DATE} [UserID: %x] location:
%l %n %p: %m%n%n


log4j.appender.R.MaxFileSize=1KB

# Keep three backup files

log4j.appender.R.MaxBackupIndex=3

   <<Less
About | Sitemap | Contact