If you turn on the Log4j status logger (<Configuration status="DEBUG">), do
you see the debug log message
from 
org.apache.logging.log4j.core.impl.Log4jContextFactory.Log4jContextFactory(ContextSelector,
ShutdownCallbackRegistry):

Using ShutdownCallbackRegistry YOUR_CLASS_INSTANCE

Or do you see an exception logged
from 
org.apache.logging.log4j.core.impl.Log4jContextFactory.createShutdownCallbackRegistry()?

Gary

On Wed, Jun 17, 2015 at 9:13 AM, Charles Allen <
[email protected]> wrote:

> I'm currently writing a lifecycle bridge between Druid.io's logging and
> log4j2's logging to make sure logs during normal shutdown hooks are
> persisted correctly. I cannot rely on JVM shutdown hook firing order but
> have a "functional" ShutdownCallbackRegistry.
>
> Is there a preferred way to get the instanced ShutdownCallbackRegistry at
> org.apache.logging.log4j.core.impl.Log4jContextFactory#shutdownCallbackRegistry
> ?
>
> I have set a class via the log4j.shutdownCallbackRegistry property, but
> cannot seem to actually get the instance used. This leaves me to either use
> reflection https://github.com/druid-io/druid/pull/1387  or static methods
> https://github.com/DjDCH/Log4j-StaticShutdown
>



-- 
E-Mail: [email protected] | [email protected]
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to