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