Log4j是在開發Java程式時,會使用的logging套件之一。網路上已經可以找到許多配置說明,在這我只分享一些心得與遇到的問題。
Log4j 1.x
Resource
- Log4j最佳实践
- A guide to logging in Java
- Log4j Tips : Use MDC or Mapped Dignostic Context to distinguish logging per Client or Request
Log4j 2.x
套用SLF4J+Log4j2最快的方法,就是套Log4j 2 SLF4J Binding,參考此連結。
- Log4j2 - Hello World!
- Indicate Log4j2 Configuration File
- MDC with Log4j2
- Log4j2 Appenders
- 在Log4j2設定TimeAndSizeRollingAppender
- Change log level at runtime
- Reload Log4j configuration
留言
張貼留言