What is the difference between log4j RollingFileAppender vs DailyRollingFileAppender

痴心易碎 提交于 2019-12-30 05:57:09

问题


What is the difference between log4j RollingFileAppender vs DailyRollingFileAppender? and why would I use one verses the other?


回答1:


Reading http://www.mail-archive.com/log4j-user@logging.apache.org/msg08183.html

  • DailyRollingFileAppender - Rotates based on dateFormat
  • RollingFileAppender - Rotates based on a maximum file size.

Also check:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html




回答2:


On DailyRollingFileAppender the file is rolled over at a user chosen frequency, but on RollingFileAppender the file is rolled when the file reaches certain size.



来源:https://stackoverflow.com/questions/5884705/what-is-the-difference-between-log4j-rollingfileappender-vs-dailyrollingfileappe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!