FYI this is what I get locally: 2014-09-24 15:55:23,982 [Thread-1] DEBUG o.x.shutdown - Starting XWiki shutdown... 2014-09-24 15:55:28,355 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.localization.wiki.internal.DocumentTranslationBundleFactory]... 2014-09-24 15:55:28,355 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.localization.wiki.internal.DocumentTranslationBundleFactory] has been stopped 2014-09-24 15:55:28,356 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.search.solr.internal.DefaultSolrIndexer]... 2014-09-24 15:55:28,356 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.search.solr.internal.DefaultSolrIndexer] has been stopped 2014-09-24 15:55:28,356 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.activeinstalls.internal.DefaultJestClientManager]... 2014-09-24 15:55:28,357 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.activeinstalls.internal.DefaultJestClientManager] has been stopped 2014-09-24 15:55:28,357 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.search.solr.internal.EmbeddedSolrInstance]... 2014-09-24 15:55:28,366 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.search.solr.internal.EmbeddedSolrInstance] has been stopped 2014-09-24 15:55:28,367 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.logging.logback.internal.LogbackEventGenerator]... 2014-09-24 15:55:28,367 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.logging.logback.internal.LogbackEventGenerator] has been stopped 2014-09-24 15:55:28,367 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.cache.infinispan.internal.InfinispanCacheFactory]... 2014-09-24 15:55:28,388 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.cache.infinispan.internal.InfinispanCacheFactory] has been stopped 2014-09-24 15:55:28,391 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.job.internal.DefaultJobExecutor]... 2014-09-24 15:55:28,391 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.job.internal.DefaultJobExecutor] has been stopped 2014-09-24 15:55:28,393 [Thread-1] DEBUG o.x.shutdown - Stopping component [org.xwiki.localization.wiki.internal.ComponentDocumentTranslationBundle]... 2014-09-24 15:55:28,393 [Thread-1] DEBUG o.x.shutdown - Component [org.xwiki.localization.wiki.internal.ComponentDocumentTranslationBundle] has been stopped 2014-09-24 15:55:28,395 [Thread-1] DEBUG o.x.shutdown - Stopping component [com.xpn.xwiki.store.hibernate.DefaultHibernateSessionFactory]... 2014-09-24 15:55:28,395 [Thread-1] DEBUG o.x.shutdown - Stopping Database Connection Pool... 2014-09-24 15:55:28,574 [Thread-1] DEBUG o.x.shutdown - Database Connection Pool has been stopped 2014-09-24 15:55:28,574 [Thread-1] DEBUG o.x.shutdown - Component [com.xpn.xwiki.store.hibernate.DefaultHibernateSessionFactory] has been stopped 2014-09-24 15:55:28,575 [Thread-1] INFO o.x.shutdown - XWiki shutdown has been completed. Thanks -Vincent On 24 Sep 2014 at 15:38:14, [email protected] ([email protected](mailto:[email protected])) wrote:
On 24 Sep 2014 at 15:30:53, Thomas Mortagne ([email protected](mailto:[email protected])) wrote:
On Wed, Sep 24, 2014 at 3:07 PM, [email protected] wrote:
On 24 Sep 2014 at 15:01:04, Thomas Mortagne ([email protected](mailto:[email protected])) 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, [email protected] 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