<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" target="_blank" style="font-family:arial,sans-serif;font-size:13px">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>