Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F9D41878B for ; Mon, 22 Jun 2015 21:42:50 +0000 (UTC) Received: (qmail 28843 invoked by uid 500); 22 Jun 2015 21:42:50 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 28788 invoked by uid 500); 22 Jun 2015 21:42:50 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 28778 invoked by uid 99); 22 Jun 2015 21:42:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2015 21:42:50 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garydgregory@gmail.com designates 209.85.218.49 as permitted sender) Received: from [209.85.218.49] (HELO mail-oi0-f49.google.com) (209.85.218.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2015 21:40:35 +0000 Received: by oiax193 with SMTP id x193so131587882oia.2 for ; Mon, 22 Jun 2015 14:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4Vg4YTh3AwjgtgY0GR48iTZg4wtX4KjE9ZvPUd252i0=; b=bCssEETMN1R/azXPiRlcstmjjl/ngXmxCIZ7zDlXQo/cJeE0mLHESUx29bZ4uxzH1d TTLkuJsISS7uDugD5Cs28jC0LyvkdGo2LIetjDe1Y7BGXlWjaLWzaR6omrEBFebId2lE YOFlTes380D2a7msNCZfSXqFdrdYAnTwnro/4Y2qS9E4nQ+hMDkihjJR9/uKPHWg9RJW vlV1ufpPRX6WfMFG/E64mIUDTgzePybQRJ51PGHjWfVdQOFtQkT0HgwOrRnmfu/eZQtT P+/BxeSFsZNva66ZtovM+TDT17GdwezSGTiZe3Cq/RGnCAPwMe8V2OgTc7hTQZPb6NaZ jUaQ== MIME-Version: 1.0 X-Received: by 10.60.45.207 with SMTP id p15mr24565914oem.34.1435009298059; Mon, 22 Jun 2015 14:41:38 -0700 (PDT) Received: by 10.60.115.162 with HTTP; Mon, 22 Jun 2015 14:41:37 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Jun 2015 14:41:37 -0700 Message-ID: Subject: Re: ShutdownCallbackRegsitry instance getter? From: Gary Gregory To: Log4J Developers List Content-Type: multipart/alternative; boundary=001a11c2090875d8a905192223a7 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2090875d8a905192223a7 Content-Type: text/plain; charset=UTF-8 YW Charles. Can you create a JIRA that describes your use case? This way we can keep trace of it and the current solution and make a note of it in the release notes for the upcoming 2.4. Gary On Mon, Jun 22, 2015 at 2:31 PM, Charles Allen < charles.allen@metamarkets.com> wrote: > Thanks Gary! > > On Mon, Jun 22, 2015 at 1:54 PM Gary Gregory > wrote: > >> FYI: The getter in is Git master now. >> >> On Mon, Jun 22, 2015 at 1:50 PM, Gary Gregory >> wrote: >> >>> I'd like to hear from Ralph and/or Remko on this. I'll add the getter >>> anyway. It seems to me that if you pass in the object in a ctor and it is >>> set in an ivar, it should be accessible via a getter. >>> >>> Gary >>> >>> >>> On Mon, Jun 22, 2015 at 1:42 PM, Charles Allen < >>> charles.allen@metamarkets.com> wrote: >>> >>>> That indeed would be one solution for my use case. >>>> >>>> If there is some other recommended method (like programmatically create >>>> the context factory and not let auto-creation do it) that is "more >>>> preferred" than simply having a getter on the factory then I would love to >>>> know about it. >>>> >>>> On Mon, Jun 22, 2015 at 1:34 PM Gary Gregory >>>> wrote: >>>> >>>>> On Mon, Jun 22, 2015 at 12:44 PM, Charles Allen < >>>>> charles.allen@metamarkets.com> wrote: >>>>> >>>>>> org.apache.logging.log4j.core.impl.Log4jContextFactory#createShutdownCallbackRegistry >>>>>> creates the instance of interest, but the resulting instance is not >>>>>> get-able without using reflection? >>>>>> >>>>> >>>>> That's true, createShutdownCallbackRegistry is called from >>>>> Log4jContextFactory constructions and not accessible from outside the class. >>>>> >>>>> You'd like a >>>>> >>>>> public ShutdownCallbackRegistry getShutdownCallbackRegistry() { >>>>> return shutdownCallbackRegistry; >>>>> } >>>>> >>>>> >>>>> added to this class? >>>>> >>>>> Gary >>>>> >>>>> >>>>>> On Mon, Jun 22, 2015 at 12:36 PM Charles Allen < >>>>>> charles.allen@metamarkets.com> wrote: >>>>>> >>>>>>> No, it is still not showing up. For the record, this is using 2.2 >>>>>>> Which seems odd because if I break on Log4jContextFactory.java:88 >>>>>>> then the shutdownCallbackRegistry is the correct custom instance if the >>>>>>> properties are set programmatically or at command line, but it simply does >>>>>>> not print out the debug message >>>>>>> >>>>>>> >>>>>>> On Mon, Jun 22, 2015 at 12:11 PM Gary Gregory < >>>>>>> garydgregory@gmail.com> wrote: >>>>>>> >>>>>>>> If you do not see the message "Using ShutdownCallbackRegistry >>>>>>>> YOUR_CLASS_INSTANCE" then that is not good. >>>>>>>> >>>>>>>> Can you try setting the system properties from the command line >>>>>>>> instead of programmatically? I wonder if Log4j is initialized _before_ your >>>>>>>> setProperty calls. >>>>>>>> >>>>>>>> Gary >>>>>>>> >>>>>>>> On Mon, Jun 22, 2015 at 11:37 AM, Charles Allen < >>>>>>>> charles.allen@metamarkets.com> wrote: >>>>>>>> >>>>>>>>> No, oddly enough. >>>>>>>>> >>>>>>>>> The following options are being set: >>>>>>>>> >>>>>>>>> properties.setProperty("log4j.shutdownCallbackRegistry", "io.druid.common.config.Log4jShutdown"); >>>>>>>>> properties.setProperty("log4j.shutdownHookEnabled", "true"); >>>>>>>>> >>>>>>>>> >>>>>>>>> I know it is getting called though and I have the following at the >>>>>>>>> start and end of my log when my main program: >>>>>>>>> >>>>>>>>> >>>>>>>>> 2015-06-22 18:32:38,543 INFO Registered Log4j as the >>>>>>>>> java.util.logging.LogManager. >>>>>>>>> 2015-06-22 18:32:38,698 DEBUG Registering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229 >>>>>>>>> 2015-06-22 18:32:38,705 DEBUG Registering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=StatusLogger >>>>>>>>> 2015-06-22 18:32:38,707 DEBUG Registering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=ContextSelector >>>>>>>>> 2015-06-22 18:32:38,710 DEBUG Registering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=Loggers,name= >>>>>>>>> 2015-06-22 18:32:38,713 DEBUG Registering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=Appenders,name=Console >>>>>>>>> 2015-06-22 18:32:38,714 DEBUG Reconfiguration complete for >>>>>>>>> context[name=1793467229] at null >>>>>>>>> (org.apache.logging.log4j.core.LoggerContext@6bfecf32) with >>>>>>>>> optional ClassLoader: null >>>>>>>>> 2015-06-22 18:32:38,714 DEBUG Shutdown hook enabled. Registering a >>>>>>>>> new one. >>>>>>>>> 2015-06-22 18:32:38,716 DEBUG LoggerContext[name=1793467229, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@6bfecf32] started OK. >>>>>>>>> 2015-06-22 18:32:40,327 DEBUG Using default SystemClock for >>>>>>>>> timestamps >>>>>>>>> >>>>>>>>> ...... >>>>>>>>> >>>>>>>>> 2015-06-22T18:33:28,999 INFO [Thread-52] >>>>>>>>> io.druid.initialization.Log4jShutterDownerModule - Shutting down log4j >>>>>>>>> callbacks >>>>>>>>> 2015-06-22 18:33:29,000 DEBUG Stopping >>>>>>>>> LoggerContext[name=1793467229, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@6bfecf32] >>>>>>>>> 2015-06-22 18:33:29,000 DEBUG Stopping >>>>>>>>> LoggerContext[name=1793467229, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@6bfecf32]... >>>>>>>>> 2015-06-22 18:33:29,000 DEBUG Unregistering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229 >>>>>>>>> 2015-06-22 18:33:29,001 DEBUG Unregistering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=StatusLogger >>>>>>>>> 2015-06-22 18:33:29,001 DEBUG Unregistering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=ContextSelector >>>>>>>>> 2015-06-22 18:33:29,001 DEBUG Unregistering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=Loggers,name= >>>>>>>>> 2015-06-22 18:33:29,002 DEBUG Unregistering MBean >>>>>>>>> org.apache.logging.log4j2:type=1793467229,component=Appenders,name=Console >>>>>>>>> 2015-06-22 18:33:29,003 DEBUG Stopped >>>>>>>>> XmlConfiguration[location=/Users/charlesallen/src/druid/common/target/classes/log4j2.xml] >>>>>>>>> OK >>>>>>>>> 2015-06-22 18:33:29,004 DEBUG Stopped >>>>>>>>> LoggerContext[name=1793467229, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@6bfecf32]... >>>>>>>>> 2015-06-22 18:33:29,004 DEBUG Stopping LoggerContext[name=Default, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@dbef480] >>>>>>>>> 2015-06-22 18:33:29,004 DEBUG Stopping LoggerContext[name=Default, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@dbef480]... >>>>>>>>> 2015-06-22 18:33:29,005 DEBUG Stopped >>>>>>>>> XmlConfiguration[location=/Users/charlesallen/src/druid/common/target/classes/log4j2.xml] >>>>>>>>> OK >>>>>>>>> 2015-06-22 18:33:29,005 DEBUG Stopped LoggerContext[name=Default, >>>>>>>>> org.apache.logging.log4j.core.LoggerContext@dbef480]... >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sat, Jun 20, 2015 at 9:04 AM Gary Gregory < >>>>>>>>> garydgregory@gmail.com> wrote: >>>>>>>>> >>>>>>>>>> If you turn on the Log4j status logger (>>>>>>>>> "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 < >>>>>>>>>> charles.allen@metamarkets.com> 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: garydgregory@gmail.com | ggregory@apache.org >>>>>>>>>> Java Persistence with Hibernate, Second Edition >>>>>>>>>> >>>>>>>>>> JUnit in Action, Second Edition >>>>>>>>>> >>>>>>>>>> Spring Batch in Action >>>>>>>>>> Blog: http://garygregory.wordpress.com >>>>>>>>>> Home: http://garygregory.com/ >>>>>>>>>> Tweet! http://twitter.com/GaryGregory >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org >>>>>>>> Java Persistence with Hibernate, Second Edition >>>>>>>> >>>>>>>> JUnit in Action, Second Edition >>>>>>>> Spring Batch in Action >>>>>>>> Blog: http://garygregory.wordpress.com >>>>>>>> Home: http://garygregory.com/ >>>>>>>> Tweet! http://twitter.com/GaryGregory >>>>>>>> >>>>>>> >>>>> >>>>> >>>>> -- >>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org >>>>> Java Persistence with Hibernate, Second Edition >>>>> >>>>> JUnit in Action, Second Edition >>>>> Spring Batch in Action >>>>> Blog: http://garygregory.wordpress.com >>>>> Home: http://garygregory.com/ >>>>> Tweet! http://twitter.com/GaryGregory >>>>> >>>> >>> >>> >>> -- >>> E-Mail: garydgregory@gmail.com | ggregory@apache.org >>> Java Persistence with Hibernate, Second Edition >>> >>> JUnit in Action, Second Edition >>> Spring Batch in Action >>> Blog: http://garygregory.wordpress.com >>> Home: http://garygregory.com/ >>> Tweet! http://twitter.com/GaryGregory >>> >> >> >> >> -- >> E-Mail: garydgregory@gmail.com | ggregory@apache.org >> Java Persistence with Hibernate, Second Edition >> >> JUnit in Action, Second Edition >> Spring Batch in Action >> Blog: http://garygregory.wordpress.com >> Home: http://garygregory.com/ >> Tweet! http://twitter.com/GaryGregory >> > -- E-Mail: garydgregory@gmail.com | ggregory@apache.org Java Persistence with Hibernate, Second Edition JUnit in Action, Second Edition Spring Batch in Action Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --001a11c2090875d8a905192223a7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
YW Charles. Can you create a JIRA that describes your use = case? This way we can keep trace of it and the current solution and make a = note of it in the release notes for the upcoming 2.4.

Ga= ry

On = Mon, Jun 22, 2015 at 2:31 PM, Charles Allen <charles.allen@m= etamarkets.com> wrote:
Thanks Gary!

=
On Mon, Jun 22, 2015 at 1:54 PM= Gary Gregory <garydgregory@gmail.com> wrote:
FYI: The getter in is Git master now.

On Mon, Jun 22, 2015 at 1:= 50 PM, Gary Gregory <garydgregory@gmail.com> wrote:
=
I'd like to hear from R= alph and/or Remko on this. I'll add the getter anyway. It seems to me t= hat if you pass in the object in a ctor and it is set in an ivar, it should= be accessible via a getter.

Gary
=

On Mon, Jun 2= 2, 2015 at 1:42 PM, Charles Allen <charles.allen@metamarkets.c= om> wrote:
That indeed would be one solution for my use case.

If t= here is some other recommended method (like programmatically create the con= text factory and not let auto-creation do it) that is "more preferred&= quot; than simply having a getter on the factory then I would love to know = about it.

On Mon, Jun 22, 2015 at 1:34 PM Gary Gregory <garydgregory@gmail.com> wrote:=
On Mon, Jun 22, 2015 at 12:44 PM, Char= les Allen <charles.allen@metamarkets.com> wrote:=
org.apache.logging.log4j.core.impl.Lo= g4jContextFactory#createShutdownCallbackRegistry creates the instance of in= terest, but the resulting instance is not get-able without using reflection= ?

=C2=A0That's true= , createShutdownCallbackRegistry is called from Log4jContextFactory constru= ctions and not accessible from outside the class.

= You'd like a=C2=A0

public ShutdownCallbackRegistry getShutdownCallbackRegist= ry() {
return shutd= ownCallbackRegistry;
}


added to this class?
=

Gary
=C2=A0
On Mon, Jun 22, 2015 at = 12:36 PM Charles Allen <charles.allen@metamarkets.com> wrote:
No, it is still not showing up. For the rec= ord, this is using 2.2
Which seems odd because if I break on Log4jConte= xtFactory.java:88 then the shutdownCallbackRegistry is the correct custom i= nstance if the properties are set programmatically or at command line, but = it simply does not print out the debug message

On Mon, Jun 22, 2015 at 12:11= PM Gary Gregory <garydgregory@gmail.com> wrote:
If you do not see the message "Using ShutdownCallbackRegistry YOUR_CLASS_INSTANCE" = then that is not good.

Can = you try setting the system properties from the command line instead of prog= rammatically? I wonder if Log4j is initialized _before_ your setProperty ca= lls.

Gary

On Mon, Jun 22, 2015 at 11:37 AM, Charles Allen <= charles.allen@metamarkets.com> wrote:
No, oddly enough.=C2=A0

The following opti= ons are being set:

properties.setProperty("log4j.shutdownCallbackRegistry"=
;, "io.drui=
d.common.config.Log4jShutdown");
properties.setProperty("log4j.shutdownHookEna= bled", &quo= t;true");

I know it is getting c= alled though and I have the following at the start and end of my log when m= y main program:


2015-06-22 18:32:38= ,543 INFO Registered Log4j as the java.util.logging.LogManager.
2= 015-06-22 18:32:38,698 DEBUG Registering MBean org.apache.logging.log4j2:ty= pe=3D1793467229
2015-06-22 18:32:38,705 DEBUG Registering MBean o= rg.apache.logging.log4j2:type=3D1793467229,component=3DStatusLogger
2015-06-22 18:32:38,707 DEBUG Registering MBean org.apache.logging.log4j= 2:type=3D1793467229,component=3DContextSelector
2015-06-22 18:32:= 38,710 DEBUG Registering MBean org.apache.logging.log4j2:type=3D1793467229,= component=3DLoggers,name=3D
2015-06-22 18:32:38,713 DEBUG Registe= ring MBean org.apache.logging.log4j2:type=3D1793467229,component=3DAppender= s,name=3DConsole
2015-06-22 18:32:38,714 DEBUG Reconfiguration co= mplete for context[name=3D1793467229] at null (org.apache.logging.log4j.cor= e.LoggerContext@6bfecf32) with optional ClassLoader: null
2015-06= -22 18:32:38,714 DEBUG Shutdown hook enabled. Registering a new one.
<= div>2015-06-22 18:32:38,716 DEBUG LoggerContext[name=3D1793467229, org.apac= he.logging.log4j.core.LoggerContext@6bfecf32] started OK.
2015-06= -22 18:32:40,327 DEBUG Using default SystemClock for timestamps
<= br>
......

2015-06-22T18:33:28,999 INFO [Thread-52] io.d= ruid.initialization.Log4jShutterDownerModule - Shutting down log4j callback= s
2015-06-22 18:33:29,000 DEBUG Stopping LoggerContext[name=3D1793467229= , org.apache.logging.log4j.core.LoggerContext@6bfecf32]
2015-06-22 18:33= :29,000 DEBUG Stopping LoggerContext[name=3D1793467229, org.apache.logging.= log4j.core.LoggerContext@6bfecf32]...
2015-06-22 18:33:29,000 DEBUG Unre= gistering MBean org.apache.logging.log4j2:type=3D1793467229
2015-06-22 1= 8:33:29,001 DEBUG Unregistering MBean org.apache.logging.log4j2:type=3D1793= 467229,component=3DStatusLogger
2015-06-22 18:33:29,001 DEBUG Unregister= ing MBean org.apache.logging.log4j2:type=3D1793467229,component=3DContextSe= lector
2015-06-22 18:33:29,001 DEBUG Unregistering MBean org.apache.logg= ing.log4j2:type=3D1793467229,component=3DLoggers,name=3D
2015-06-22 18:3= 3:29,002 DEBUG Unregistering MBean org.apache.logging.log4j2:type=3D1793467= 229,component=3DAppenders,name=3DConsole
2015-06-22 18:33:29,003 DEBUG S= topped XmlConfiguration[location=3D/Users/charlesallen/src/druid/common/tar= get/classes/log4j2.xml] OK
2015-06-22 18:33:29,004 DEBUG Stopped LoggerC= ontext[name=3D1793467229, org.apache.logging.log4j.core.LoggerContext@6bfec= f32]...
2015-06-22 18:33:29,004 DEBUG Stopping LoggerContext[name=3DDefa= ult, org.apache.logging.log4j.core.LoggerContext@dbef480]
2015-06-22 18:= 33:29,004 DEBUG Stopping LoggerContext[name=3DDefault, org.apache.logging.l= og4j.core.LoggerContext@dbef480]...
2015-06-22 18:33:29,005 DEBUG Stoppe= d XmlConfiguration[location=3D/Users/charlesallen/src/druid/common/target/c= lasses/log4j2.xml] OK
2015-06-22 18:33:29,005 DEBUG Stopped LoggerContex= t[name=3DDefault, org.apache.logging.log4j.core.LoggerContext@dbef480]...




On Sat, Jun 20, 2015 at 9:04 AM Gary Gregory <= garydgregory@gm= ail.com> wrote:
If you tu= rn on the Log4j status logger (<Configuration <= span style=3D"line-height:18px;font-family:Monaco,Menlo,Consolas,'Couri= er New',monospace;font-size:13px;white-space:pre-wrap;color:teal">statu= s=3D"DEBUG">),= do you see the debug log message from=C2=A0org.apache.logging.log4j.core.i= mpl.Log4jContextFactory.Log4jContextFactory(ContextSelector, ShutdownCallba= ckRegistry):

Using ShutdownCallbackRegistry YOUR_CLASS_I= NSTANCE

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

Gary

On Wed, Jun 17, 2015 at 9:13 AM, Charles Al= len <charles.allen@metamarkets.com> wrote:
I'm currently writing a lifecycle brid= ge between Druid.io's logging and log4j2's logging to make sure log= s during normal shutdown hooks are persisted correctly. I cannot rely on JV= M shutdown hook firing order but have a "functional" ShutdownCall= backRegistry.

Is there a preferred way t= o get the instanced ShutdownCallbackRegistry at org.apache.logging.log4j.co= re.impl.Log4jContextFactory#shutdownCallbackRegistry ?

I have set a class via the log4j.shutdownCallbackRegistry proper= ty, but cannot seem to actually get the instance used. This leaves me to ei= ther use reflection=C2=A0https://github.com/druid-io/druid/pull/1387=C2= =A0=C2=A0or static methods=C2=A0https://github.com/DjDCH/Log4j-StaticShutd= own






--



--
=


--



--
= --001a11c2090875d8a905192223a7--