Instead of using hacks in various code that might be called during
shutdown, why not dynamically enable debug log just before starting
shutdown in XWikiServletContextListener#contextDestroyed for example ?
You could control that trigger with some configuration.

On Wed, Sep 24, 2014 at 3:38 PM, vinc...@massol.net <vinc...@massol.net> wrote:
>
>
>
>
>
> On 24 Sep 2014 at 15:30:53, Thomas Mortagne 
> (thomas.morta...@xwiki.com(mailto:thomas.morta...@xwiki.com)) wrote:
>
>> On Wed, Sep 24, 2014 at 3:07 PM, vinc...@massol.net wrote:
>> >
>> >
>> >
>> >
>> >
>> > On 24 Sep 2014 at 15:01:04, Thomas Mortagne 
>> > (thomas.morta...@xwiki.com(mailto:thomas.morta...@xwiki.com)) wrote:
>> >
>> >> It's not very clear for me where you exactly plan to use that.
>> >
>> > For the “org.xwiki.shutdown” logger:
>> >
>> > - ECM (dispose())
>> > - XWikiServletContextListener
>> > - DBCPConnectionProvider
>>
>> Not all that is about XWiki shutting down, each time you delete a wiki
>> ECM#dispose() is called to dispose the CM associated to that wiki.
>
> ok, then we could call it “org.xwiki.disposal” or “org.xwiki.cleanup”.
>
> Thanks
> -Vincent
>
>> > For the “org.xwiki.initialization” one I don’t know yet, I haven’t done 
>> > it. Basically at places where important subsystems are initialized. Some 
>> > ideas:
>> >
>> > - InitializableLifecycleHandler
>> > - SOLR init (maybe not needed if done through Initializable)
>> > - EM init (maybe not needed if done through Initializable)
>> > - ...
>> >
>> > Thanks
>> > -Vincent
>> >
>> >> On Wed, Sep 24, 2014 at 2:06 PM, vinc...@massol.net wrote:
>> >> > 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:
>> >> >
>> >> >
>> >> >
>> >> > A small variation would be to use SHUTDOWN_LOGGER.info() and in 
>> >> > logback.xml, by default to have:
>> >> >
>> >> >
>> >> >
>> >> > 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
> _______________________________________________
> devs mailing list
> devs@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs



-- 
Thomas Mortagne
_______________________________________________
devs mailing list
devs@xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to