Pradeep Sreekumar wrote:
But changing the threshold level from INFO to DEBUG is not printing my DEBUG logs
How are you changing that? And where exactly is that log4j.xml located? And which version of JBoss AS?
I tried manually editing the log4j.xml in server\default\conf folder.
Jboss version is 4.2.3
If you change the correct log4j.xml file it should have an effect.
If you use a EAP (supported version of JBoss) the file is named 'jboss-log4j.xml'.
Also you must change the log4j configuration within the right folder, in you case the server must be started with '-c default' to be sure.
I am starting jboss from eclipse ide.
Also in jboss admin console under log4j section, file name is mentioned as log4j.xml
while i am changing the file, i can see logs in console that log4j configuration change done.So i think file is getting reloaded.My doubt is regarding the log4j xml configuration.
Ok, that looks good.
I don't know what the default is for priority, so change as followed:
<category name="com.test.api" additivity="false">
You might drop the Threshold element if you want a full logging file (normally I use is for additional appender like CONSOLE/MAIL etc.
For more log4j configuration and information see http://logging.apache.org/log4j/1.2/manual.html
My requirement is to change the log level dynamically.
Currently INFO to DEBUG switch is happening and config file is reloaded.
But issue is that other DEBUG logs are coming.
But its not coming for com.api.test category that i defined
These are the logger statements used.
info and fatal logs are coming. But debug logs are not getting printed
Is that the exact code and config file you are using? If not, please post real code.