Open MohammadNC opened 1 month ago
Hi @MohammadNC,
Can you explain what are you trying to achieve? Which level do you set to DEBUG
?
Your programmatic configuration seems equivalent to:
<Loggers>
<Root level="INFO">
<BurstFilter onMatch="ACCEPT onMismatch="DENY" level="${filterNewLogLevel|"/>
<AppenderRef ref="console"/>
</Root>
<Logger name="com.oracle.cgbu.cne"
level="${appLevel}/>
</Loggers>
What values of ${filterNewLogLevel}
and ${appLevel}
are you using?
Hi @ppkarwasz ,
Thank you for your response, please check below requested details.
In my application, there is a feature to dynamically update log levels and control the log rate. When we update the log level at the application level, all Java classes in the application adopt this new log level.
Here's my issue: When I set the log level to "INFO", "WARN", or "ERROR" at the application level, all classes correctly log messages at the respective levels. However, there is one specific class, LciUtility.java, that continues to print DEBUG level logs even when the application log level is set to INFO, WARN, or ERROR.
Note: The LciUtility class is located within the same application package as the other classes.
Additional details: appLevel refers to the application-level log setting. filterNewLogLevel specifies the log level at which log rate control needs to be applied.
Kindly check this info and provide suggestions how to resolve this issue.
Hi @MohammadNC,
Here's my issue: When I set the log level to "INFO", "WARN", or "ERROR" at the application level, all classes correctly log messages at the respective levels. However, there is one specific class, LciUtility.java, that continues to print DEBUG level logs even when the application log level is set to INFO, WARN, or ERROR.
Note: The LciUtility class is located within the same application package as the other classes.
There is nothing in LciUtility
that stands out. My guess is that you might have a <Logger>
configuration that is more specific that "com.comp.cgbu.cne" (e.g. com.comp.cgbu.cne.Lciutility
). If this is the case, modifications of the log level for "com.comp.cgbu.cne" do not propagate to the logger of the LciUtility
class.
Since local JMX is enabled in Log4j Core up to 2.23.1
, the easiest way to verify it is to start jconsole
and attach it to the running application. The MBean's for all logging contexts should be available in the org.apache.logging.log4j2
JMX domain.
Hi Team,
Debug level logs are getting printed when log level is set WARN, please refer the below log4j configs and sample java code where Debug logs are getting printed.
java code:
I am updating log level dynamically and log controller with below code reference.
Kindly suggest how we can to prevent this behaviour.
Regards, Mohammad.