Dear Simin,

as you set
log4j.appender.A1.MaxBackupIndex=1
you could only expect one or two log files. I used the following config file
in which I set the max files size to 1KB so that "many" files were created:

#**************************************************************************
# Rolling-File Appender
# do not forget to set layout
#**************************************************************************
log4j.appender.RolFileApp=org.apache.log4j.RollingFileAppender
log4j.appender.RolFileApp.File=C:/tmp/rollingFile.log
log4j.appender.RolFileApp.layout=org.apache.log4j.PatternLayout
log4j.appender.RolFileApp.MaxFileSize=1
log4j.appender.RolFileApp.MaxBackupIndex=5

Hope that helped you?
Thilo

-----Original Message-----
From: Simin Zolfaghari [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 3. Mai 2001 17:21
To: Log4j-user
Subject: Rolling log file



Hi,

I will  know has anyone used the Rolling Featur from Log4j?I mean
theCreating of  backup f. I have problem with it
I have implemented a Simple class " LogImpl"  that included one Catagory
named "CAT".
I have to to specify a MaxFileSize and a Backupfile. The test-application
with this Class run correctly.
But there was only one time a bakeupfile  with the name
C:/itp/logImpl/logtest.log.1  
but not other more. Wenn i repeated  the test, it wasn't anymore  backeup
file created and the exist bakeupFile C:/itp/logImpl/logtest.log.1   was
disposed.
i don'nt know why only one time was the bakeup file created. 
the Configuration file look like.


# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG, A1
  

# A1 is set to be a FileAppender which outputs to test.log. 
#log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.Append=true
log4j.appender.A1.File=C:/itp/logImpl/logtest.log
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c{1} %x - %m%n
  
log4j.appender.A1.MaxFileSize=10KB
# Keep one backup file
log4j.appender.A1.MaxBackupIndex=1

log4j.category.CAT=DEBUG

Tanks
Simin
___________________________________________________

---------------------------------------------------------------------
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]

Reply via email to