logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, Jay" <Jay.Tur...@sabre-holdings.com>
Subject How do I hook in before log4j starts?
Date Mon, 18 Jul 2011 14:40:53 GMT
I want to be able to connect my new LoggerRepository to log4j before log4j runs its default
initialization. But log4j seems to initialize before any significant code of mine is run.
What causes the log4j initialization (statics?, get* calls?)? What can I execute before log4j
initialization is triggered to hook in?

In detail, I have log4j.configuration=my.xml and log4j initializes with it. The issue is that
I have created a new LoggerRepository that is the same as the base one but that implements
UnrecognizedElementHandler. Now I want to hook that in so that log4j initialization uses my
code while initializing. What happens right now is that I have to reinitialize again just
to get the new elements. Without additivity=false there would be issues with duplicates, but
initializing the system twice is inefficient and can cause other side effects.

Thank you,
Jay Turner


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message