[英]How to reconfigure log4j of a war file from another war file deployed in same tomcat
I have two war files WARA and WARB deployed in a tomcat, both use same log4j properties file. 我在tomcat中部署了两个war文件WARA和WARB,它们都使用相同的log4j属性文件。 How to reset the log4j configurations in both war files through another stand alone application deployed in same tomcat without disturbing WARA and WARB? 如何通过部署在同一雄猫中的另一个独立应用程序重置两个war文件中的log4j配置,而又不影响WARA和WARB? Is it possible to do? 有可能吗?
If polling is an option you can use PropertyConfigurator.configureAndWatch()
. 如果可以选择轮询,则可以使用PropertyConfigurator.configureAndWatch()
。
If you need to do it manually the process is bit longer. 如果您需要手动执行此过程,则过程会更长一些。 On a high level its as follows. 在高层次上,其如下。
If you can provide more details on what software stack your are using I may be able to provide specific details on how to do the above. 如果您可以提供有关正在使用的软件堆栈的更多详细信息,我也许可以提供有关如何执行上述操作的特定详细信息。
不是最好的方法,而是制作一个包含属性文件的jar文件,并将其放置在tomcat lib文件夹中,所有应用程序都使用相同的propertyfiles。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.