当前位置:网站首页>Logback log framework learning and problems
Logback log framework learning and problems
2022-06-13 07:26:00 【Small side good side】
1、 brief introduction
http://logback.qos.ch/, Chinese website http://www.logback.cn/
logback from log4j The founder of Ceki Gülcü Design , As log4j Successor to the framework ,logback Indeed, it is widely used . But from the updated records on the official website , Looks like 2019 Years later, the update speed was obviously slow , I don't know if it's time to go log4j The afterlife of .
Logback from logback core、logback classic and logback access Three modules .logback core It lays the foundation for the other two modules ,logback classic Realized SLF4J API, In this way, our application can switch between other logging frameworks , Such as log4j、java.util.logging (JUL).logback access And servlet Containers ( Such as tomcat or Jetty) Integrate , Provide HTTP To access logs .
2、 Core components
Logback Three core components :Logger、Appender、Layout, The three work together , This allows developers to record messages by message type and level , And control the format of these messages and the location where they are recorded at run time .
3、 To configure
3.1 logback Profile path
The order in which the configuration files are found
(1)classpatch Find... In the path logback-test.xml
(2)classpatch Find... In the path logback.groovy
(3)classpatch Find... In the path logback.xml
(4) Custom profile path , Add... To the startup parameters logback.configurationFile Specify the profile path , Such as :
There are other ways that have not been studied .
3.2 The configuration syntax

4、 Compatibility support
log4j Users can use the PropertiesTranslator take log4j The configuration is converted to logback To configure
5、 problem
5.1 The log file subscript exceeds 1000 Do not delete old files

When the log file subscript exceeds 1000 when , Don't delete files ,totalSizeCap It doesn't work ,bug link :https://jira.qos.ch/browse/LOGBACK-1297
It's still in open state .
terms of settlement , take SizeAndTimeBasedRollingPolicy It is amended as follows FixedWindowRollingPolicy+SizeBasedTriggeringPolicy The way
Single file 10kb, Keep at most 5 File , Make the file subscript always in 1-5 Between , Not more than 1000:
5.2 SizeAndTimeBasedRollingPolicy Method does not precisely control size
Set a single file size 100kb, Total size 1MB when 
It is found that the single file size is far larger than 100kb, Total size also exceeds 1MB
Decompress the log file and find , Single file size 1696KB
But the total size is maintained at 2.12 MB about , There has been no sustained growth
边栏推荐
- P6154 游走(记忆化搜索
- Monotone stack top31 of interview must brush algorithm top101
- RT thread simulator lvgl control: slider control
- 【硬记】脏读、不可重复读、幻读场景核心区别
- Calculate running total / running balance
- Make cer/pfx public and private key certificates and export CFCA application certificates
- Tree list under winfrom treelist related
- oracle问题,字段里面的数据被逗号隔开,取逗号两边数据
- 9. process control
- JMeter encryption interface test
猜你喜欢
![[weak transient signal detection] matlab simulation of SVM detection method for weak transient signal under chaotic background](/img/11/d6cd333a2fa56af2dc61b7597f1ada.png)
[weak transient signal detection] matlab simulation of SVM detection method for weak transient signal under chaotic background

Learning notes of balanced binary tree -- one two pandas

TiDB Lightning

Nfv basic overview

Make cer/pfx public and private key certificates and export CFCA application certificates

Try to use renderdoc to view the shader code of UE

Powerdispatcher reverse generation of Oracle data model

Raspberry school advanced development - "writing of IO port driver code" includes bus address, physical \u virtual address and bcm2835 chip manual knowledge

redis-7. Redis master-slave replication, cap, Paxos, cluster sharding cluster 02

10 Honest Facts I Want To Share With All Junior Developers
随机推荐
Pdf to word
汇编语言基础:寄存器和寻址方式
How to use clion to debug a project built by the make tool
检测循环数“142857“
P1434 [SHOI2002] 滑雪 (记忆化搜索
Table access among Oracle database users
How is it that the income of financial products is zero for several consecutive days?
ISIS的vsys(虚拟系统)
Que se passe - t - il si les produits financiers sont nuls pendant plusieurs jours?
[splashsplash] repeat the script that outputs splashsurf
What does my financial product mean in clearing?
Adding certificates to different systems
Word document export
Issues related to C # delegation and events
MySQL query timeout control
MySQL does not recommend setting the column default value to null. Why on earth is this
8. process status and transition
关于c#委托、事件相关问题
Problems encountered during commissioning of C # project
Raspberry school advanced development - "writing of IO port driver code" includes bus address, physical \u virtual address and bcm2835 chip manual knowledge