logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: JULi bridge & log4j Configurator
Date Wed, 25 Apr 2007 11:27:20 GMT

On Apr 25, 2007, at 1:50 AM, Curt Arnold wrote:

>
> Probably not good for log4j 1.2.x itself to have any special  
> knowledge of a companion.  If configurator needs to know details  
> like the class name of the bridge, then the whole thing should go  
> into log4j 1.2.x itself.
>
> Any chance that you could stretch and somehow express this thing as  
> an object type that DOMConfigurator already knows about?  For  
> example, could this be a "special" type of Renderer, Appender, or  
> Logger where you could do something like:
>
> <renderer class="org.apache.log4j.julibridge.BridgeRenderer"/>
>
> to instantiate the bridge without any new log4j side code.
>

Don't know if you were considering a bridge going from log4j to  
java.util.logging, but that direction should fit into the appender  
model fairly well.  You could design an "appender" for taking log4j  
logging events and outputting them to java.util.logging.Logger  
calls.  It would be configured something like:

<!-- takes log4j events and calls java.util.logging -->
<appender name="bridge"  
class="org.apache.log4j.julibridge.JULIAppender">
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%-5p %c{2} - %m%n"/>
     </layout>
</appender>

<root>
	<appender-ref ref="bridge"/>
</root>


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.

<!-- 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.






---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message