当前位置:网站首页>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>边栏推荐
猜你喜欢

Standing on the shoulders of big men, you can see further

Business visualization - make your flowchart'run'(4. Actual business scenario test)

21天学习挑战赛-《Autosar从入门到精通-实战篇》

What is cross domain? How to solve the cross domain problem?

Detailed explanation of various types of files in MySQL

NTU Lin Xuantian's "machine learning cornerstone" problem solving and code implementation | [you deserve it]

478-82(56、128、718、129)

C# 之 方法参数传递机制

With such a simple verification, 80% of programmers can't do it, let alone understand it!

ShardingSphere之分库分表概念介绍(二)
随机推荐
Express builds a simple local background (1)
JS array is de duplicated, the ID is the same, and a value is added and merged
Introduction to SD card (based on spec3.0)
MQ learning
The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
Learn a hammer.Net zero foundation reverse tutorial lesson 3 (shell and homework)
ActivityRouter源码解析
[Guangxi University] information sharing of postgraduate entrance examination and re examination
Retrofit source code analysis
可以伸缩的搜索栏,模仿华为应用市场
This wechat plug-in is very easy to use
C signed and unsigned byte variables
[collection] linear algebra let me think - Summary of chapter topics
JDBC连接数据库
实验五:用户与用户组管理
View事件分发机制源码解析
MATLAB启动慢解决措施
IDC script file running
【广西大学】考研初试复试资料分享
OSS直连上传-Rails服务实践