当前位置:网站首页>logback 中FileAppender具有什么功能呢?
logback 中FileAppender具有什么功能呢?
2022-07-29 06:58:00 【qq_25073223】
转自:
下文笔者讲述FileAppender的功能简介说明,如下所示:
logback中FileAppender的功能: 用于将日志添加到文件中 FileAppender属性说明
<file>:设置写入的文件名,可以是相对目录,也可以是绝对目录,如果上级目录不存在会自动创建,没有默认值 <append>:当设置为true,日志被追加到文件结尾,当设置为false,则清空现存文件,默认是true <encoder>:对记录事件进行格式化(具体参数稍后讲解) <prudent>:当设置为true,日志会被安全的写入文件,即使其他的FileAppender也在向此文件做写入操作,效率低,默认是 false。
例
//把>=DEBUG级别的日志都输出到testFile.log
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>javatestlog.log</file>
<append>true</append>
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="FILE" />
</root>
</configuration>边栏推荐
- Interface test actual project 03: execute test cases
- 如何使用gs_expansion扩展节点
- Vagrant box cluster processing
- thinkphp6 实现数据库备份
- 做开发4年13K,想转行自动化测试,薪资还能涨吗···
- WPF嵌套布局案例
- Vscode remote debugging PHP solution through remotessh and Xdebug
- MVFuseNet:Improving End-to-End Object Detection and Motion Forecasting through Multi-View Fusion of
- Synchronous / asynchronous, blocking / non blocking and IO
- 对Vintage分析的一些学习理解
猜你喜欢

最新百亿量化私募名单

论文阅读 (62):Pointer Networks

MySQL - multi table query

2022-07-28: what is the output of the following go language code? A:AA; B:AB; C:BA; D:BB。 package main import ( “fmt“ ) func main() { f

Synchronous / asynchronous, blocking / non blocking and IO

Kubernetes (V) -- deploy kubernetes dashboard

女研究生做“思维导图”与男友吵架!网友:吵架届的“内卷之王”....

Operator3-设计一个operator

Interface test actual project 03: execute test cases

My personal website doesn't allow access to wechat, so I did this
随机推荐
Synchronous / asynchronous, blocking / non blocking and IO
gin 路由,参数,输出
330. 按要求补齐数组
数组的子集不能累加出的最小正数
gin 中间件
能在SQL 语句中 指定 内存参数吗?
It's enough for MySQL to have this article (disgusting and crazy typing 37k words, just for Bo Jun's praise!!!)
女研究生做“思维导图”与男友吵架!网友:吵架届的“内卷之王”....
[Charles' daily problems] when you open Charles, you can't use nails
数组的子集能否累加出K
After three years of outsourcing, the salary of automatic testing after job hopping is twice that of the original. The secret is
5-整合swagger2
Redis Basics
Homebrew brew update doesn't respond for a long time (or stuck in updating homebrew...)
使用VsCode配置MySQL实现连接、查询、等功能
route的meta配置项
Remote invocation of microservices
Spingboot integrates the quartz framework to realize dynamic scheduled tasks (support real-time addition, deletion, modification and query tasks)
做开发4年13K,想转行自动化测试,薪资还能涨吗···
作业7.28 文件IO与标准IO