Hi Devs,
I’d like to add some logging to debug what happens when XWiki shuts down.
One solution would be to just use the standard class loggers with LOGGER.debug(…).
However this means activating debug logging for everything and thus you cannot just focus
on the shutdown part.
WDYT about adding 2 new loggers "org.xwiki.initialization" and
“org.xwiki.shutdown”?
Example usage:
/**
* Logger to use to log shutdown information.
*/
private static final Logger SHUTDOWN_LOGGER =
LoggerFactory.getLogger("org.xwiki.shutdown");
...
SHUTDOWN_LOGGER.debug("Stopping component [{}]...",
instance.getClass().getName());
...
SHUTDOWN_LOGGER.debug("Component [{}] has been stopped",
instance.getClass().getName());
Then it becomes easy to set, in logback.xml:
<logger name=“org.xwiki.shutdown" level=“debug"/>
A small variation would be to use SHUTDOWN_LOGGER.info() and in logback.xml, by default to
have:
<logger name=“org.xwiki.shutdown" level=“warn"/>
Note that this would be the first time we use non-class loggers which is why I’m asking
for your go-ahead.
Thanks
-Vincent