On Apr 25, 2007, at 8:45 AM, Paul Smith wrote:
To take messages from java.util.logging and dispatch them into
log4j would require some key to signify the appender should work
in reverse. Don't have a great name for it, but import might work.
Receiver? :)
<!-- takes java.util.logging events and calls log4j -->
<appender class="org.apache.log4j.julibridge.JULIAppender">
<param name="import" value="true"/>
</appender>
I was putting log4j related sandbox projects under ".../logging/
sandbox/log4j". Since the sandbox is likely only a temporary
home, I don't see any need to move it.
I'm not sure about JULI. Seems a little cute. SLF4J calls it
JDK14. I think calling the project "logging-log4j-bridge", using
the package org.apache.log4j.bridge and the class "JDK14Appender"
would be better.
For some reason I always thought people referred to
java.util.logging as JULI, but maybe I've just had it wrong. Easy
to change the names though.
I'd be less keen on adding support to bridge the other way around.
We're trying to help people who want to use log4j, rather than
those who want to use java.util.logging stuff.
As per how this gets configured, the approach to make it configure
based on being a Renderer/Appender might work, but that's even
hackier than my original hack idea to have some reflective based
code that can detect the companion code and use it. Obviously this
is a 'plugin', so perhaps some combination of the component stuff
with this might work.
For now though, if users do want to use it, it's only 1 line of
code, post log4j configuration, so perhaps we simply leave it for
now until we've bedded down the component & receiver stuff for
log4j 1.2
Paul
On reflection, it does seem like the bridge from JULI to log4j seems
conceptually similar to the existing receivers and a bridge from
log4j to JULI really seems like a appender. I'm thinking that JULI-
>log4j bridge should join the other receivers in apache-logging-
receivers. If there is a log4j->JULI bridge it would be a distinct
custom appender project.
My current thought is to add a UnrecognizedElementHandler interface
that would allow DOMConfigurator to delegate the handling of
unrecognized elements. Top level elements would be dispatched to the
logging hierarchy if it supported that interface, elements in an
appender element would go to the corresponding appender et al. If
you used a RepositorySelector to return a LoggingRepositoryExImpl,
then the stock 1.2.15 DOMConfigurator would be able to handle plugin
elements (like a plugin for the bridge). The stock 1.2.15
DOMConfigurator could also handle the policy child elements for the
rolling file appenders, but there would still need to be a special
configuator for anyone using the o.a.l.rolling.RFA's with earlier
log4j 1.2.x's.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]