Backlog, SLF4J and jars using other logging frameworks

Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks. I created the error using the following code: logger = org.slf4j.LoggerFactory.getLogger("test1"); jdkLogger = java.util.logging.Logger.getLogger("test2"); logger.debug("Backlog logs ...") jdkLogger.info("JDK Logs ...") and my backlog.xml <?xml version="1.0" encoding="UTF-8"?> <configuration scan="false" debug="false" > <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern> </encoder> </appender> <root level="WARN"> <appender-ref ref="stdout"/> </root> </configuration> When I execute the code, I see a log output from test2 while test1 gets filtered by backlog. I was expecting that both messages to get filtered by SLF4J/Backlog. I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath. I appreciate your comments, -A

Hi, -------- Original-Nachricht --------
Datum: Sun, 7 Nov 2010 17:41:40 +1100 Von: Ali Salehi <salehiam@gmail.com> An: logback-user@qos.ch Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks.
SLF4J/Backlog. Logback ;-))
I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath.
I appreciate your comments,
I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation. Dieter Mueller. -- GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl

Thanks, I added jul-to-slf4j-1.6.1.jar to the classpath. Unfortunately I am still getting logs produced by java.util.log as shown in the code. -A On Sun, Nov 7, 2010 at 8:23 PM, "Dieter Müller" <d.m@streber24.de> wrote:
Hi,
-------- Original-Nachricht --------
Datum: Sun, 7 Nov 2010 17:41:40 +1100 Von: Ali Salehi <salehiam@gmail.com> An: logback-user@qos.ch Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks.
SLF4J/Backlog. Logback ;-))
I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath.
I appreciate your comments,
I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation.
Dieter Mueller.
-- GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Hi, Am 07.11.2010 10:36 schrieb Ali Salehi:
Thanks, I added jul-to-slf4j-1.6.1.jar to the classpath. Unfortunately I am still getting logs produced by java.util.log as shown in the code.
Strange. I've never used jul, but successfully bridged jcl (java.commons.logging) and log4j to SLF4J/logback. But try to use the same logging-level for both loggers, just to figure it out. Dieter Mueller
-A
On Sun, Nov 7, 2010 at 8:23 PM, "Dieter Müller" <d.m@streber24.de <mailto:d.m@streber24.de>> wrote:
Hi,
-------- Original-Nachricht -------- > Datum: Sun, 7 Nov 2010 17:41:40 +1100 > Von: Ali Salehi <salehiam@gmail.com <mailto:salehiam@gmail.com>> > An: logback-user@qos.ch <mailto:logback-user@qos.ch> > Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
> Hi all, > I have a dependency to a jar file which is using java.util.logging. My > code > uses Logback/slf4j framework. As I understood, slf4j will proxy other > logging frameworks. > > SLF4J/Backlog. Logback ;-)) > > I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and > logback-core-0.9.24.jar files in my classpath. > > I appreciate your comments, > I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation.
Dieter Mueller.

I think you have to configure JULI to use JULI-over-slf4j. There are full details on the SLF4J bridging legacy APIs page. On 7 Nov 2010, at 10:32, DM <d.m@streber24.de> wrote:
Hi,
Am 07.11.2010 10:36 schrieb Ali Salehi:
Thanks, I added jul-to-slf4j-1.6.1.jar to the classpath. Unfortunately I am still getting logs produced by java.util.log as shown in the code.
Strange. I've never used jul, but successfully bridged jcl (java.commons.logging) and log4j to SLF4J/logback.
But try to use the same logging-level for both loggers, just to figure it out.
Dieter Mueller
-A
On Sun, Nov 7, 2010 at 8:23 PM, "Dieter Müller" <d.m@streber24.de <mailto:d.m@streber24.de>> wrote:
Hi,
-------- Original-Nachricht --------
Datum: Sun, 7 Nov 2010 17:41:40 +1100 Von: Ali Salehi <salehiam@gmail.com <mailto:salehiam@gmail.com>> An: logback-user@qos.ch <mailto:logback-user@qos.ch> Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks.
SLF4J/Backlog. Logback ;-))
I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath.
I appreciate your comments,
I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation.
Dieter Mueller.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Yeah, JUL requires special configuration because it can't be done by providing stub classes because JUL is always present. If I recall there is some pretty significant overhead involved compared with the other brigdes. On Nov 7, 2010 5:44 AM, "Robert Elliot" <rob@lidalia.org.uk> wrote:
I think you have to configure JULI to use JULI-over-slf4j. There are full details on the SLF4J bridging legacy APIs page.
On 7 Nov 2010, at 10:32, DM <d.m@streber24.de> wrote:
Hi,
Am 07.11.2010 10:36 schrieb Ali Salehi:
Thanks, I added jul-to-slf4j-1.6.1.jar to the classpath. Unfortunately I am still getting logs produced by java.util.log as shown in the code.
Strange. I've never used jul, but successfully bridged jcl (java.commons.logging) and log4j to SLF4J/logback.
But try to use the same logging-level for both loggers, just to figure it out.
Dieter Mueller
-A
On Sun, Nov 7, 2010 at 8:23 PM, "Dieter Müller" <d.m@streber24.de <mailto:d.m@streber24.de>> wrote:
Hi,
-------- Original-Nachricht --------
Datum: Sun, 7 Nov 2010 17:41:40 +1100 Von: Ali Salehi <salehiam@gmail.com <mailto:salehiam@gmail.com>> An: logback-user@qos.ch <mailto:logback-user@qos.ch> Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks.
SLF4J/Backlog. Logback ;-))
I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath.
I appreciate your comments,
I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation.
Dieter Mueller.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Thanks guys, problem fixed. -A On Sun, Nov 7, 2010 at 9:57 PM, Nikolas Everett <nik9000@gmail.com> wrote:
Yeah, JUL requires special configuration because it can't be done by providing stub classes because JUL is always present. If I recall there is some pretty significant overhead involved compared with the other brigdes. On Nov 7, 2010 5:44 AM, "Robert Elliot" <rob@lidalia.org.uk> wrote:
I think you have to configure JULI to use JULI-over-slf4j. There are full details on the SLF4J bridging legacy APIs page.
On 7 Nov 2010, at 10:32, DM <d.m@streber24.de> wrote:
Hi,
Am 07.11.2010 10:36 schrieb Ali Salehi:
Thanks, I added jul-to-slf4j-1.6.1.jar to the classpath. Unfortunately I am still getting logs produced by java.util.log as shown in the code.
Strange. I've never used jul, but successfully bridged jcl (java.commons.logging) and log4j to SLF4J/logback.
But try to use the same logging-level for both loggers, just to figure it out.
Dieter Mueller
-A
On Sun, Nov 7, 2010 at 8:23 PM, "Dieter Müller" <d.m@streber24.de <mailto:d.m@streber24.de>> wrote:
Hi,
-------- Original-Nachricht --------
Datum: Sun, 7 Nov 2010 17:41:40 +1100 Von: Ali Salehi <salehiam@gmail.com <mailto:salehiam@gmail.com>> An: logback-user@qos.ch <mailto:logback-user@qos.ch> Betreff: [logback-user] Backlog, SLF4J and jars using other logging frameworks
Hi all, I have a dependency to a jar file which is using java.util.logging. My code uses Logback/slf4j framework. As I understood, slf4j will proxy other logging frameworks.
SLF4J/Backlog. Logback ;-))
I have slf4j-api-1.6.1.jar, logback-classic-0.9.24.jar and logback-core-0.9.24.jar files in my classpath.
I appreciate your comments,
I think, you shoud add the bridging jar jul-to-slf4j.jar to the classpath too, because this will forward the java logger output to slf4j (interface) and in the end to logback as implementation.
Dieter Mueller.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
participants (5)
-
"Dieter Müller"
-
Ali Salehi
-
DM
-
Nikolas Everett
-
Robert Elliot