Log4j 地址: https://logging.apache.org/log4j/2.x/faq.html
备忘:
配置结构:
Configuration
- Properties
- property
- Appenders
- Console = CONSOLE
- RollingRandomAccessFile = accessFile
- Filters
- ShadowFilter
- PatternLayout
- Policies
- TimeBasedTriggeringPolicy
- SizeBasedTriggeringPolicy
- DefaultRolloverStrategy
- Delete
- IfFileName
- IfLastModified
- IfAny
- IfAccumulatedFileSize
- IfAccumulatedFileCount
- RollingRandomAccessFile = shadowAccessFile
- loggers
- Logger 包级别-日志监听
- root
- AppenderRef = accessFile
- AppenderRef = shadowAccessFile
- AppenderRef = ${sys:drip.logging.log4j2.console.ref-name:-null}
参考链接:
https://www.cnblogs.com/cndarren/p/12021596.html
https://logging.apache.org/log4j/2.x/manual/appenders.html#RoutingAppender
https://docs.spring.io/spring-boot/docs/1.5.19.RELEASE/reference/htmlsingle/#howto-configure-log4j-for-logging
https://logging.apache.org/log4j/2.x/manual/appenders.html#RoutingAppender