<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">just an idea:</span></div>
<span style="font-family:arial,sans-serif;font-size:13px">slf4j-log4j12-1.7.7.jar sounds like a binding for log4j 1.2 not for log4j 2.0. So I would guess it's a wrong binding. No idea if there exists a 2.0 Binding. See </span><font face="arial, sans-serif"><a href="http://logging.apache.org/log4j/2.x/log4j-slf4j-impl/">http://logging.apache.org/log4j/2.x/log4j-slf4j-impl/</a></font><div>
<br></div><div>Regards<br style="font-family:arial,sans-serif"><div><font face="arial, sans-serif">Niels</font></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-28 20:53 GMT+02:00 Mike Wertheim <span dir="ltr"><<a href="mailto:mikew@hyperreal.org" target="_blank">mikew@hyperreal.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I am trying to migrate my app from log4j 1.2 to log4j 2.0.  My app uses log4j directly, and it also uses a third party library that uses slf4j.</span><br style="font-family:arial,sans-serif;font-size:13px">


<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">I put following jar files in my Classpath:</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">log4j-api-2.0.jar, log4j-core-2.0.jar</span><br style="font-family:arial,sans-serif;font-size:13px">


<span style="font-family:arial,sans-serif;font-size:13px">slf4j-api-1.7.7.jar, slf4j-log4j12-1.7.7.jar</span><br style="font-family:arial,sans-serif;font-size:13px"><br style="font-family:arial,sans-serif;font-size:13px">


<span style="font-family:arial,sans-serif;font-size:13px">When I try to start my app, the third party library's use of slf4j causes this exception to be thrown:</span><br style="font-family:arial,sans-serif;font-size:13px">


<br style="font-family:arial,sans-serif;font-size:13px"><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">java.lang.NoClassDefFoundError: org/apache/log4j/Level</font></div><div style="font-family:arial,sans-serif;font-size:13px">


<font face="courier new, monospace">    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)</font></div>


<div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)</font></div><div style="font-family:arial,sans-serif;font-size:13px">


<font face="courier new, monospace">    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="courier new, monospace">    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)</font></div>


<div style="font-family:arial,sans-serif;font-size:13px"><br></div><span style="font-family:arial,sans-serif;font-size:13px">This is not surprising, since the log4j 2.0 migration page (</span><a href="http://logging.apache.org/log4j/2.x/manual/migration.html" style="font-family:arial,sans-serif;font-size:13px" target="_blank">http://logging.apache.org/log4j/2.x/manual/migration.html</a><span style="font-family:arial,sans-serif;font-size:13px">) says: "The main package in version 1 is </span><font face="courier new, monospace" style="font-size:13px">org.apache.log4j</font><span style="font-family:arial,sans-serif;font-size:13px">, in version 2.0 it is</span><font face="courier new, monospace" style="font-size:13px">org.apache.logging.log4j</font><span style="font-family:arial,sans-serif;font-size:13px">"</span><div style="font-family:arial,sans-serif;font-size:13px">


<br></div><div style="font-family:arial,sans-serif;font-size:13px">Am I correct that the slf4j developers will need to make some modifications to slf4j to enable compatibility with log4j 2.0 (specifically, changing slf4j to look for the log4j classes in <font face="courier new, monospace">org.apache.logging.log4j</font> rather than <font face="courier new, monospace">org.apache.log4j</font>)?</div>


<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Or is there some workaround to this issue that I can do now?</div><div style="font-family:arial,sans-serif;font-size:13px">


<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Mike</div></div>


<br>_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br></blockquote></div><br></div>