You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Havaldar, Raghu" <Ra...@ONSTAR.com> on 2002/07/18 19:20:41 UTC
CompositeRollingAppender: does it work ?
Has anyone got CompositeRollingAppender (from contribs) working ?
It seems to be able to rollover based on time-only, and does not do
it in combination with size.
-raghu
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: CompositeRollingAppender: does it work ?
Posted by Kevin Steppe <ks...@pacbell.net>.
Raghu,
Below are three config files for the CompositeRollingAppender,
you'll be interested in the one at the bottom. You should change the
Category references to Logger (it's been a little while since I wrote
it). Hopefully this will work for you.
Kevin
#Config file for CompositeRollingAppender
#Example 1, config to use CompositeRollingAppender in Size based Backups
only
log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.CompositeRollingAppender
#How to perform rolling -- 1 = By Size
#Note -- this is the only difference from RollingFileAppender!
log4j.appender.R.RollingStyle=1
#file to log to
log4j.appender.R.File=example.log
#Size Rolling params
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxSizeRollBackups=10
#layout options
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-------------------------------------------------------------------------------
#Config file for CompositeRollingAppender
#Example 2, config to use CompositeRollingAppender in Time based Backups
only
log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.CompositeRollingAppender
#How to perform rolling -- 2 = By Time
#Note -- this is the only difference from DailyRollingFileAppender!
log4j.appender.R.RollingStyle=2
#file to log to
log4j.appender.R.File=example.log
#Date Rolling params
log4j.appender.R.datePattern='.'yyyy-MM-dd
#layout options
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
-------------------------------------------------------------------------------------------
#Example 3, Composite
#Default Config file for CompositeRollingAppender
log4j.rootCategory=debug, R
log4j.appender.R=org.apache.log4j.CompositeRollingAppender
#How to perform rolling -- Composite is the default
log4j.appender.R.RollingStyle=3
#Use same file name for all inprocess logging?
log4j.appender.R.staticLogFileName=true
log4j.appender.R.File=example.log
#Size Rolling params
log4j.appender.R.CountDirection=-1
log4j.appender.R.MaxFileSize=5KB
log4j.appender.R.MaxSizeRollBackups=10
#Date Rolling params
log4j.appender.R.datePattern='.'yyyy-MM-dd
#layout options
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
Havaldar, Raghu wrote:
>Has anyone got CompositeRollingAppender (from contribs) working ?
>It seems to be able to rollover based on time-only, and does not do
>it in combination with size.
>
>-raghu
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>