logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Rillbert <anders.rillb...@tritech.se>
Subject Rolling file appender does not roll for file sizes larger than a couple of kB
Date Thu, 13 Oct 2005 15:24:33 GMT
Hi,
I'm facing a problem using the RollingFileAppender.
If I set the max file size to 20KB, the log rolls over as expected but if I
change the size to 200KB, it does not. Instead it overwrites the first
logfile.

Here's the successful case:
--- Log4j.properties:
### direct messages to file nclog ###
log4j.appender.nclog=org.apache.log4j.RollingFileAppender
log4j.appender.nclog.File=nclog log4j.appender.nclog.Append=true
log4j.appender.nclog.MaxFileSize=20KB
log4j.appender.nclog.MaxBackupIndex=5
log4j.appender.nclog.layout=org.apache.log4j.PatternLayout
log4j.appender.nclog.layout.ConversionPattern=%d{DATE} %-5p [%t] %C{1}:%m%n

--- Debug printouts from log4j:
log4j: Using URL
[file:/D:/andersr/projects/ComSel/Abaris/Product/CS-100100/SW_work/network_c
ontrol/NCServer/etc/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL
file:/D:/andersr/projects/ComSel/Abaris/Product/CS-100100/SW_work/network_co
ntrol/NCServer/etc/log4j.properties
log4j: Parsing for [root] with value=[debug, nclog].
log4j: Level token is [debug].
log4j: Category root set to DEBUG
log4j: Parsing appender named "nclog".
log4j: Parsing layout options for "nclog".
log4j: Setting property [conversionPattern] to [%d{DATE} %-5p [%t]
%C{1}:%m%n].
log4j: End of parsing for "nclog".
log4j: Setting property [maxFileSize] to [20KB].
log4j: Setting property [append] to [true].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Setting property [file] to [nclog].
log4j: setFile called: nclog, true
log4j: setFile ended
log4j: Parsed "nclog" options.
log4j: Parsing for [org.hibernate] with value=[info,nclog].
log4j: Level token is [info].
log4j: Category org.hibernate set to INFO
log4j: Parsing appender named "nclog".
log4j: Appender "nclog" was already parsed.
log4j: Handling log4j.additivity.org.hibernate=[null]
log4j: Parsing for [se.tritech.meshnet.nc.transport.TransportLayer] with
value=[debug,stdout].
log4j: Level token is [debug].
log4j: Category se.tritech.meshnet.nc.transport.TransportLayer set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d{DATE} [%t] %C{1}:%m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Handling
log4j.additivity.se.tritech.meshnet.nc.transport.TransportLayer=[null]
log4j: Finished configuring.
log4j: rolling over count=52094
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended
log4j: rolling over count=20514
log4j: maxBackupIndex=5
log4j: Renaming file nclog.1 to nclog.2
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended

And here's the unsuccessful case:
--- Log4j.properties:
### direct messages to file nclog.txt ###
log4j.appender.nclog=org.apache.log4j.RollingFileAppender
log4j.appender.nclog.File=nclog log4j.appender.nclog.Append=true
log4j.appender.nclog.MaxFileSize=200KB
log4j.appender.nclog.MaxBackupIndex=5
log4j.appender.nclog.layout=org.apache.log4j.PatternLayout
log4j.appender.nclog.layout.ConversionPattern=%d{DATE} %-5p [%t] %C{1}:%m%n

--- Debug printout
log4j: Using URL
[file:/D:/andersr/projects/ComSel/Abaris/Product/CS-100100/SW_work/network_c
ontrol/NCServer/etc/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL
file:/D:/andersr/projects/ComSel/Abaris/Product/CS-100100/SW_work/network_co
ntrol/NCServer/etc/log4j.properties
log4j: Parsing for [root] with value=[debug, nclog].
log4j: Level token is [debug].
log4j: Category root set to DEBUG
log4j: Parsing appender named "nclog".
log4j: Parsing layout options for "nclog".
log4j: Setting property [conversionPattern] to [%d{DATE} %-5p [%t]
%C{1}:%m%n].
log4j: End of parsing for "nclog".
log4j: Setting property [maxFileSize] to [200KB].
log4j: Setting property [append] to [true].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Setting property [file] to [nclog].
log4j: setFile called: nclog, true
log4j: setFile ended
log4j: Parsed "nclog" options.
log4j: Parsing for [org.hibernate] with value=[info,nclog].
log4j: Level token is [info].
log4j: Category org.hibernate set to INFO
log4j: Parsing appender named "nclog".
log4j: Appender "nclog" was already parsed.
log4j: Handling log4j.additivity.org.hibernate=[null]
log4j: Parsing for [se.tritech.meshnet.nc.transport.TransportLayer] with
value=[debug,stdout].
log4j: Level token is [debug].
log4j: Category se.tritech.meshnet.nc.transport.TransportLayer set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d{DATE} [%t] %C{1}:%m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Handling
log4j.additivity.se.tritech.meshnet.nc.transport.TransportLayer=[null]
log4j: Finished configuring.
log4j: rolling over count=204964
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended
log4j: rolling over count=204894
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended
log4j: rolling over count=204856
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended
log4j: rolling over count=204824
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended
log4j: rolling over count=204828
log4j: maxBackupIndex=5
log4j: Renaming file nclog to nclog.1
log4j: setFile called: nclog, false
log4j: setFile ended

I'm running this on a Windows XP platform.

Greatful for any info

/Anders Rillbert

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


Mime
View raw message