| How to change the logging configuration on the fly [message #652890] |
Mon, 07 February 2011 08:22  |
|
Hi everyone,
I'm wondering if it is possible to change the logging configuration without restarting Virgo. I tried to add the scan and scanPeriod attribute to the configuration element in serviceability.xml but that leads to Virgo not starting up properly. I get an org.eclipse.virgo.medic.log.impl.logback.LoggerContextConfig urationFailedException saying that it is not able to find the URL of the file to scan. Next I checked in the JMX console but couldn't find anything there. Last thing I tried was to refresh the SLF4J bundle but that leads to a lot of bundles getting refreshed and some bundles not starting up again. Moreover it doesn't recognize any change in the configuration file.
Could someone tell me if it's somehow possible to change the logging configuration without restarting Virgo?
Thx
Frieder
|
|
|
|
|
|
|
|
| Re: How to change the logging configuration on the fly [message #653595 is a reply to message #653424] |
Thu, 10 February 2011 06:18  |
|
| Ric Klaren wrote on Wed, 09 February 2011 18:30 | Adding a <jmxConfigurator /> tag to the serviceability.xml does work (partially).
[..] reloadDefaultConfiguration and reloadByFileName do not work.
|
Hi Ric,
thank you for the hint. I did some testing on my own and made the following observations:
(1) As you already said getLoggerLevel/setLoggerLevel/getLoggerEffectiveLevel are working fine.
(2) reloadDefaultConfiguration throws a NullPointerException and breaks the whole logging in Virgo. Though I think it's working as intended (from logback's point of view) as there are no config files available that are named logback.xml, logback-test.xml or logback.groovy. See JMXConfigurator.java#101 and ContextInitializer.java#118.
(3) reloadByFileName works fine for me in case I provide an absolute path (I used C:/Java/virgo-web-server-2.1.0.RELEASE/config/serviceability .xml). Though one has to be careful that there aren't any errors in the config file otherwise it will throw an exception and stop logging (but I guess that's more of a logback issue than a Virgo issue).
Thx
Frieder
|
|
|
Powered by
FUDForum. Page generated in 0.01733 seconds