记一次上线部分docker不打日志的问题排查

一次正常的上线,发了几台docker后,却发现有的机器打了info.log里面有日志,有的没有。排查问题开始:

  • 第一:确认这台docker是否有流量进来,确认有流量进来。
  • 第二:确认这台docker磁盘是否慢了,磁盘没有满。
  • 第三:确认这台docker日志级别,确认和其他docker一样配置文件。
  • 第四:这个时候就不知道了,病急乱投医,把部署的包,docker的cpu、内存、tcp、线程数、gc都看了一遍,都是正常的。
  • 最后:和同事探讨,看catlina启动的时候有没有warning日志,结果有所发现。

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/Packages/XXXXXX/20190716102533/WEB-INF/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/Packages/XXXXXX/20190716102533/WEB-INF/lib/log4j-slf4j-impl-2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

这个时候就很明显了,两个包冲突,有有一样的绝对路径,导致类加载选择了其中一个。所以回导致有的docker不打日志。最后排除jar包,重新上线,都正常。

总结:不能只看启动日志有无startup,有无异常信息,对这些warning日志也要留意。

posted @ 2019-07-19 09:26  wudiffs  阅读(1560)  评论(0编辑  收藏  举报