Log4j2之RollingFileAppender学习笔记
来源:互联网 发布:mac文件夹属性隐藏 编辑:程序博客网 时间:2024/06/07 07:23
RollingFileAppender
The RollingFileAppender is an OutputStreamAppender that writes to the File named in the fileName parameter and rolls the file over according the TriggeringPolicy and the TolloverPolicy. The RollingFileAppender uses a RollingFileManager to actually perform the file I/O and perform the rollover.
A RollingFileAppender requires a TriggeringPolicy and a RolloverStrategy. The triggering policy determines if a rollover should be performed while the RolloverStrategy defines how the rollover should be done.
Triggering Policies
Composite Triggering Policy
The CompositeTriggeringPolicy combines multiple triggering policies and returns true if any of the configured policies return true. The CompositeTriggeringPolicy is configured simply by wrapping other policies in a Policies element.
Cron Triggering Policy
The CronTriggeringPolicy triggers rollover based on a cron expression.
CronTriggeringPolicy Parameters
OnStartup Triggering Policy
The OnStartupTriggeringPolicy policy causes a rollover if the log file is older than the current JVM’s start time and the minimum file size if met or exceeded.
OnStartupTriggeringPolicy Parameters
SizeBased Triggering Policy
The SizeBasedTriggeringPolicy causes a rollover once the file has reached the specified size. The size can be specified in bytes, with the suffix KB, MB, or GB for example 20MB.
TimeBased Triggering Policy
The TimeBasedTriggeringPolicy causes a rollover once the date/time pattern no longer applies to the active file. This policy accepts an interval attribute which indicates how frequently the rollover should occur based on the time pattern and a modulate boolean attribute.
TimeBasedTriggeringPolicy Parameters
- Log4j2之RollingFileAppender学习笔记
- log4j2之Layouts学习笔记
- log4j2教程【RollingFileAppender】
- log4j学习笔记--ConversionPattern参数详解-- RollingFileAppender选项
- RollingFileAppender
- RollingFileAppender
- Log4j2官方文档翻译、学习笔记之一——log4j2基础配置及功能概述
- Log4j2官方文档翻译、学习笔记之二——Appender的分类及常用类型示例
- Log4j2官方文档翻译、学习笔记之三——Layouts的分类及常用类型示例
- 记录我的学习笔记-Java-log4j2的使用
- log4j2使用笔记
- log4j2 使用笔记
- Log4j2入门学习
- log4J2学习记录
- Log4j2学习成果
- 日志学习:SLF4J & Log4J2
- log4j2 从零开始学习使用方法
- log4j2.xml基础学习
- Android多线程的四种方式
- spring mvc集成mybatis进行数据库访问
- mybatis 缓存
- bfs hdu 1241
- CentOS 编译vim no terminal library found
- Log4j2之RollingFileAppender学习笔记
- rails中active_record的delete和destroy方法
- 如何拍出更好看的照片,那是有技巧的
- sparkmllib (1)
- appium使用教程
- 【Java】【注解】自定义注解
- 通过六个题目彻底掌握String笔试面试题
- 缓存行
- 【转】linux下杀死进程(kill)的N种方法