JoyLau / joylau-springboot-daemon-windows

将SpringBoot应用制作为Windows Services服务 | make spring boot module to windows services
http://image.joylau.cn/blog/joylau-springboot-daemon-service-video.mp4
MIT License
68 stars 38 forks source link

日志如何拆分 #10

Open william-abel opened 4 years ago

william-abel commented 4 years ago

设置在某个地方输出 但是我Log4j2怎么使用呢? 不可能吧日志全部输出到一个文件中啊

JoyLau commented 4 years ago

日志如何拆分得看你 log4j 的配置文件, 一般日志框架都有按日志级别分文件写入, 还有回滚策略, 按照日志文件的大小或者按照日期来回滚, 建议您看看 log4j 日志配置这块 另外, springboot 默认使用的 logback 已足够优秀, 我上面说的功能都可以实现, 只需在 resources 目录下 配置 logback-config.xml 文件, 并配置

logging:
  config: classpath:logback-config.xml

即可