Differences between org.apache.log4j.RollingFileAppender and org.apache.log4j.rolling.RollingFileAppender

StackOverflow https://stackoverflow.com/questions/18405335

문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top