I am using the below java code to set the level to debug but still printing INFO and other levels except Trace level.
LoggerContext context = (LoggerContext) LogManager.getContext(false);
Configuration config = context.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig("org.mule.runtime.core.internal.processor.LoggerMessageProcessor");
loggerConfig.setLevel(Level.DEBUG);
context.updateLoggers(config);
Console Output :
DEBUG 2022-08-17 22:33:50,499 [[MuleRuntime].uber.02: [dynamiclogger].dynamicloggerFlow1.CPU_LITE @112f86df] [processor: dynamicloggerFlow1/processors/0; event: 90dbce00-1e4e-11ed-a2e8-646e69d7e195] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: *********************DEBUG LEVEL*************************************
INFO 2022-08-17 22:33:50,499 [[MuleRuntime].uber.02: [dynamiclogger].dynamicloggerFlow1.CPU_LITE @112f86df] [processor: dynamicloggerFlow1/processors/1; event: 90dbce00-1e4e-11ed-a2e8-646e69d7e195] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: *********** INFO LEVEL ***********************
Thanks Rizwan.
Hi @Ryan Anthony Andal
Thanks for your response .
I have tried with the suggested changes . It seems like the Log Level is changing but what i observed is that it is not printing only that level log if it is at lower level .
For eg: If there are 3 logger with the Level DEBUG, INFO , WARN in my Flow .
- When I am changing the Level to DEBUG . It print's logs for DEBUG, INFO and WARN logger.
- When changing to INFO . It print's INFO and WARN logs, not DEBUG.
- When changing to WARN . It only prints WARN logger not INFO and DEBUG.
I just want to print only the logger which I am changing at Runtime. Please suggest.
Thanks ,
Rizwanul.