当前位置:网站首页>SizeBasedTriggeringPolicy简介说明
SizeBasedTriggeringPolicy简介说明
2022-07-28 09:23:00 【qq_25073223】
转自:
下文笔者将讲述SizeBasedTriggeringPolicy的简介说明,如下所示
SizeBasedTriggeringPolicy的功能: 观察当前活动文件的大小 当已经大于了指定的值,它会给 RollingFileAppender 发一个信号触发对当前活动文件的轮转 SizeBasedTriggeringPolicy属性
maxFileSize:字节
千字节
兆字节
千兆字节
通过在数值后面指定一个后缀 KB,MB 或者 GB
如:5000000,5000KB,5MB 以及 2GB 都是有效的,前三个是一样的(默认值是 10 MB)
例
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>test.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>test.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>3</maxIndex>
</rollingPolicy>
<!--当文件大小超过5MB时,通知RollingPolicy轮转-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n
</pattern>
</encoder>
</appender>边栏推荐
猜你喜欢

How promise instance solves hell callback

JS array is de duplicated, the ID is the same, and a value is added and merged

IJCAI 2022 | the latest overview of graph structure learning: research progress and future prospects

就这么一个简单的校验,80%的程序员却做不到,更不理解!

WPF布局之控件随着窗口等比放大缩小,适应多分辨率满屏填充应用

Machine learning (10) -- hypothesis testing and regression analysis

时序分析41 - 时序预测 TBATS模型

The maximum recommended number of rows for MySQL is 2000W. Is it reliable?

express搭建一个简易的本地后台(一)

使用 OpenSSL 创建ssl证书
随机推荐
[collection] linear algebra let me think - Summary of chapter topics
ShardingSphere简介(一)
Basic operation of MATLAB
[gossip] the development of programmers needs two abilities most
With frequent data leakage and deletion events, how should enterprises build a security defense line?
The secret behind three salary increases a year
2.9.5 ext JS object type processing and convenient methods
Analysis of the internal principle of ArrayList
Seeing clearly is more important than walking fast, because you can go far only when you walk right
Translation recommendation | debugging bookkeeper protocol - unbounded ledger
[multithreading] non atomic agreement of long and double
就这么一个简单的校验,80%的程序员却做不到,更不理解!
Opencv4.60 installation and configuration
Arouter source code analysis (I)
译文推荐 | 调试 BookKeeper 协议 - 无界 Ledger
Database core system
Method parameter transfer mechanism of C #
Window源码解析(四):Window的删除机制
[vscode] vscode usage
[autosar-rte] - introduction of 2-component, component and VFB