-
1. Re: need example arg for getLoggerLevel
rhcp Feb 12, 2004 9:19 AM (in response to larrys)I dont know how to use the getLoggerLevel mehtod but there is a smarter way to configure your level attribute!
Go to the conf/log4j.xml file and add a new category e.g. like thiscategory name="myApp.myCat" priority value="INFO" appender-ref ref="CONSOLE" category
and then init your Logger toLogger log= Logger.getLogger("myApp.myCat");
there you are (do the same with your own appenders).
regards,
Uli -
2. Re: need example arg for getLoggerLevel
larrys Feb 12, 2004 1:48 PM (in response to larrys)Thanks. But what I want to do is use the web-console to switch root logger (or some other logger) log levels at runtime. If I understand correctly, editing log4j.xml will require a restart of jboss. I want to be able to switch to DEBUG, do some debugging, and then switch back to INFO, for example.
-
3. Re: need example arg for getLoggerLevel
rhcp Feb 13, 2004 1:50 AM (in response to larrys)Hi,
thats right modifying the log4j need a reboot. But you can init some default settings like your default level. When you like to change the level on the fly try the following:Logger log= Logger.getRootLogger(); //Logger log= Logger.getLogger("myApp"); log.setLevel(Level.DEBUG); ... log.setLevel(Level.INFO);
regards,
Uli -
4. Re: need example arg for getLoggerLevel
pilhuhn Feb 14, 2004 5:53 AM (in response to larrys)Hm. On 3.2.1 and 3.2.3, Jboss picks up modifications of log4j.xml within the next 30 seconds without a reboot.