Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用探针和tomcat。我部署在 tomcat 7 中的应用程序使用 log4j 进行日志记录。我为我的应用程序传递了 -Dlog4j.configuration(启动时)。
我也在我的应用程序日志文件中从探针获取日志。
为什么会这样?
-Dlog4j.configuration 将为部署在 tomcat 进程中的所有 webapp 的所有 log4j 相关日志记录设置此 log4j 配置。
因此,要为每个 webapp 指定单独的 log4j 配置,最好的方法是将它捆绑在你的战争中。