<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Look at the the log4j 2 manual <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I believe it will be fixed when you include the log4j 2 -> 1.2 bridge for any code that cannot be changed to log4j2  or replace </span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>slf4j-api-1.7.7.jar/slf4j-log4j12-1.7.7.jar</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>  with the log4j 2 -> SLF4J bridge (log4j-slf4j-impl-2.0.jar) for code using SLF4J<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html">http://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><a href="http://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html">http://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html</a> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> slf4j-user [mailto:slf4j-user-bounces@qos.ch] <b>On Behalf Of </b>niels<br><b>Sent:</b> Tuesday, July 29, 2014 1:28 AM<br><b>To:</b> User list for the slf4j project<br><b>Subject:</b> Re: [slf4j-user] trouble migrating from log4j 1.2 to log4j 2.0<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi,</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>just an idea:</span><o:p></o:p></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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><span style='font-family:"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></span><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Regards<o:p></o:p></p><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Niels</span><o:p></o:p></p></div></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>2014-07-28 20:53 GMT+02:00 Mike Wertheim <<a href="mailto:mikew@hyperreal.org" target="_blank">mikew@hyperreal.org</a>>:<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Hi,<br><br>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.<br><br>I put following jar files in my Classpath:<br>log4j-api-2.0.jar, log4j-core-2.0.jar<br>slf4j-api-1.7.7.jar, slf4j-log4j12-1.7.7.jar<br><br>When I try to start my app, the third party library's use of slf4j causes this exception to be thrown:</span><o:p></o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>java.lang.NoClassDefFoundError: org/apache/log4j/Level</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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"><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>http://logging.apache.org/log4j/2.x/manual/migration.html</span></a><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>) says: "The main package in version 1 is </span><span style='font-size:10.0pt;font-family:"Courier New"'>org.apache.log4j</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>, in version 2.0 it is</span><span style='font-size:10.0pt;font-family:"Courier New"'>org.apache.logging.log4j</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>"</span><o:p></o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>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 </span><span style='font-size:10.0pt;font-family:"Courier New"'>org.apache.logging.log4j</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'> rather than </span><span style='font-size:10.0pt;font-family:"Courier New"'>org.apache.log4j</span><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>)?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Or is there some workaround to this issue that I can do now?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Mike<o:p></o:p></span></p></div></div><p class=MsoNormal><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><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>