由于本文是边学习边实践,比较啰嗦,想拿来就用的同学移步:https://blog.csdn.net/w_jiayou/article/details/106943376
之前只是把现成的xml文件拿来用,想要调整日志很费劲,今天从头开始边学习边测试
一、空的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds" debug="true">
</configuration>
既然决定要好好整理一下,就从什么都没有开始配置,启动项目:
com.springboot.demo02020623.Demo02020623Application
Connected to the target VM, address: '127.0.0.1:58330', transport: 'socket'
09:30:48,100 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/D:/workspace/idea-workspace/demo02020623/target/classes/logbackConfig.xml]
09:30:48,203 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 10 seconds
09:30:48,222 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:30:48,223 |-INFO in org.springframework.boot.logging.logback.SpringBootJoranConfigurator@1869fbd2 - Registering current configuration as safe fallback point
09:30:48,230 |-WARN in Logger[org.springframework.boot.context.logging.ClasspathLoggingApplicationListener] - No appenders present in context [default] for logger [org.springframework.boot.context.logging.ClasspathLoggingApplicationListener].
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.1.RELEASE)
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.3.1.tmp
除了一点打印出logback内部日志信息,啥都没有;
二、控制台输出
在xml配置中conf