Context
In the project I am (production environment) has a server that is installed with 4 java applications, being:
- 1 deployed Jetty application
- 1 application in Tomcat
- 2 jar generated with Spring Boot framework
All applications are separate, meaning each application has a dedicated JVM. For log control, each application implements its Log4J, using log4j.properties file (each application has its own file) to configure and control the log level.
Problem
In application 1 (JETTY App) I need to create two menus with the options:
When the admin user at runtime selects the Active Log Debug
option, the 4 applications running on the server should start generating log level Debug
. The same occurs in the case of the Active Log Error option, all 4 applications should start generating log level Error
.
I thought about the following alternatives:
1) Read the file .properties
of the applications (installation directory) and change the level of LOG accordingly, replace the property of propertyConfigurator.configure()
to PropertyConfigurator.configureAndWatch
(RUNTIME)
2) Submit the -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=TRACE
command for each JVM (RUNTIME)
I do not know if this way of thinking is coherent and will work.
Does anyone have any ideas or have you experienced any similar problem, multiple Log4J in multiple JVMs?