Springboot:logback日志管理(九)
标签:als 开发 mep utf-8 files 添加 插入 监测 rac
Springboot默认使用的日志框架就是logback
创建自定义的logback-spring.xml放在resources类目录下即可
logback-spring.xml:
springboot_logbacktrace[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] [%thread] --%mdc{client} %msg%nUTF-8${log.path}/log_debug.log[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] [%thread] --%mdc{client} %msg%nUTF-8${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log100MB30debugACCEPTDENY${log.path}/log_info.log[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] [%thread] --%mdc{client} %msg%nUTF-8${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log100MB30infoACCEPTDENY${log.path}/log_warn.log[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] [%thread] --%mdc{client} %msg%nUTF-8${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log100MB30warnACCEPTDENY${log.path}/log_error.log[%date{yyyy-MM-dd HH:mm:ss}] [%-5level] [%logger:%line] [%thread] --%mdc{client} %msg%nUTF-8${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log100MB30ERRORACCEPTDENY
java调用:
Logger logger = LoggerFactory.getLogger(当前类名.class);
Springboot:logback日志管理(九)
标签:als 开发 mep utf-8 files 添加 插入 监测 rac
原文地址:https://www.cnblogs.com/applesnt/p/12682955.html
评论