-
1. Re: Jboss log4j level dynamic switch
jaikiran Oct 11, 2010 1:45 AM (in response to pradeepsreekumar)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?
-
2. Re: Jboss log4j level dynamic switch
pradeepsreekumar Oct 11, 2010 5:05 AM (in response to jaikiran)Hi,
I tried manually editing the log4j.xml in server\default\conf folder.
Jboss version is 4.2.3
-
3. Re: Jboss log4j level dynamic switch
wdfink Oct 11, 2010 7:51 AM (in response to pradeepsreekumar)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.
-
4. Re: Jboss log4j level dynamic switch
pradeepsreekumar Oct 11, 2010 11:18 AM (in response to wdfink)Hi
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.
-
5. Re: Jboss log4j level dynamic switch
wdfink Oct 11, 2010 12:00 PM (in response to pradeepsreekumar)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">
<priority value="DEBUG"/><appender-ref ref="FILE"/>
</category>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
-
6. Re: Jboss log4j level dynamic switch
pradeepsreekumar Oct 12, 2010 2:01 AM (in response to wdfink)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.
logger.info("dsfdsfdsjfksdflksdlf;dsfdsf");
logger.debug("debuggggggggggggggggggggggggggggg");
logger.fatal("fatalllllllllllllllllllllllllll");info and fatal logs are coming. But debug logs are not getting printed
-
7. Re: Jboss log4j level dynamic switch
jaikiran Oct 12, 2010 2:04 AM (in response to pradeepsreekumar)Is that the exact code and config file you are using? If not, please post real code.