<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hello David, <br><br>I'm not writting SLF4J i'm just using logback in programmatically configuration way. The idea is to have a logger configured inside an API which will be used by all the other applications, so i have created just some classes (with apprenders...)&nbsp; which implements logger and call super.debug.... and add my other functions ( with specific behaviors : ie mytrace will send entry data to an activemq...) . in this class i configure all the appenders and attach them to the root logger . this way if an application is using a file logback.xml it will be ignored (actually the configuration will be rewrited by my api) <br><br>As those classes uses Appender and other stuff that are not implemented (not yet) in log4j-over-slf4j&nbsp; so can't be used <br><br>So now to get log4j logs to be redirected to my API i use a something like : <br><br>create a class which extends log4j appender, transfrom the log4j LoggingEvent to logback LoggingEvent and then call doAppend of my API<br><br>Log4j config : <br><br>log4j.rootLogger=INFO, out<br><br># Log level for each package<br><br>#Redirect all log4j calls to my api <br>log4j.appender.out=com.company.api.tool.Log4JWrapper<br><br>Is there any other way more clean to do that ?<br><br>Thanks <br><br><div>&gt; CC: logback-user@qos.ch<br>&gt; From: nabble@diroussel.xsmail.com<br>&gt; Date: Sat, 27 Aug 2011 20:14:54 +0100<br>&gt; To: logback-user@qos.ch<br>&gt; Subject: Re: [logback-user] How to redirect log4j and other to logback ?<br>&gt; <br>&gt; The logback docs cover redirecting log4j to slf4j. <br>&gt; <br>&gt; Are you saying you've written you own slf4j backend?<br>&gt; <br>&gt; David<br>&gt; <br>&gt; On 26 Aug 2011, at 15:29, BAKHTI Mohammed &lt;onlymed@hotmail.com&gt; wrote:<br>&gt; <br>&gt; &gt; <br>&gt; &gt; Hello, <br>&gt; &gt; <br>&gt; &gt; I have an api (jar) where i configure logback appenders and loggers (in code) and add some other functions (mytraceAction()...) which will be used by all my other projects <br>&gt; &gt; <br>&gt; &gt; the idea is to give all projects an api so they have just to  getInstance() and log  (the functions added are for access and actions trace over JMS appender)<br>&gt; &gt; <br>&gt; &gt; Everything is working well the question is about the other API which use : log4j jcl ... how can i got their log and treat them in my api ? is it possible ?<br>&gt; &gt; <br>&gt; &gt; i tried to use jcl-over-slf4j ... but when they are in my libs i just don't see any other logs then those who use my api (means no spring, hibernate ... logs )<br>&gt; &gt; <br>&gt; &gt; thanks <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; _______________________________________________<br>&gt; &gt; Logback-user mailing list<br>&gt; &gt; Logback-user@qos.ch<br>&gt; &gt; http://qos.ch/mailman/listinfo/logback-user<br>&gt; _______________________________________________<br>&gt; Logback-user mailing list<br>&gt; Logback-user@qos.ch<br>&gt; http://qos.ch/mailman/listinfo/logback-user<br></div>                                               </div></body>
</html>