Differences between org.apache.log4j.RollingFileAppender and org.apache.log4j.rolling.RollingFileAppender
Asked Answered
G

2

6

Can someone tell what are different between this things? Moreover, I can't understand, why needs use TimeBasedRollingPolicy if DailyRollingFileAppender exists ?

Gal answered 23/8, 2013 at 14:28 Comment(0)
B
7

org.apache.log4j.RollingFileAppender is used to roll files when they reach a defined size.

org.apache.log4j.rolling.RollingFileAppender is a more generic and configurable rolling appender that allows for different rolling and triggering policies.

From the org.apache.log4j.RollingFileAppender documentation:

RollingFileAppender extends FileAppender to backup the log files when they reach a certain size. The log4j extras companion includes alternatives which should be considered for new deployments and which are discussed in the documentation for org.apache.log4j.rolling.RollingFileAppender.

And the org.apache.log4j.rolling.RollingFileAppender documentation:

RollingFileAppender extends FileAppender to backup the log files depending on RollingPolicy and TriggeringPolicy.

Byelorussian answered 23/8, 2013 at 17:23 Comment(1)
Can I use both types of Appenders in my log4j.xml?Eldoraeldorado
M
2

The URL has changed and is now: http://logging.apache.org/log4j/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html

Micrometeorology answered 26/9, 2014 at 19:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.