[Bug 234] New: log4j-over-slf4j and legacy projects providing their own log4j LoggerFactory

http://bugzilla.slf4j.org/show_bug.cgi?id=234 Summary: log4j-over-slf4j and legacy projects providing their own log4j LoggerFactory Product: SLF4J Version: 1.6.x Platform: All OS/Version: All Status: NEW Severity: blocker Priority: P1 Component: log4j-over-slf4j AssignedTo: slf4j-dev@qos.ch ReportedBy: laurent.pellegrino@gmail.com I tried to use log4j-over-slf4j in a legacy project that provides its own LoggerFactory and when I use log4j-over-slf4j I get a java.lang.NoSuchMethodError for Logger#getLogger(String name, LoggerFactory factory). After having inspected the log4j-over-slf4j source code, it seems that the bridge does not provide an implementation for the Logger#getLogger(String name, LoggerFactory factory) method. Is there any reason for that? -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=234 laurent.pellegrino@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |laurent.pellegrino@gmail.co | |m -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=234 --- Comment #1 from Piotr <piotr.jagielski@op.pl> 2012-06-04 20:04:23 CEST --- Created attachment 86 --> http://bugzilla.slf4j.org/attachment.cgi?id=86 propsed patch This issue prevented me from using owasp-esapi-java with SLF4J. I'm attaching a patch that worked for me. I added basic getLogger(String name, LoggerFactory loggerFactory) method implementation and changed access modified of Logger class to protected so that it can be extended in custom logger factories. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=234 Ceki Gulcu <listid@qos.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |listid@qos.ch --- Comment #2 from Ceki Gulcu <listid@qos.ch> 2012-06-04 21:23:29 CEST --- Hi Piotr, Thanks you for your patch. You are surely aware that log4j-over-slf4j does not ship with a LoggerFactory implementation. If the LogManager.getLogger(String, LoggerFactory) method is called, the caller must provide his/her own implementation. I cannot be sure that such an implementation would be possible using log4j-over-slf4j. Since the patch works for you, I am assuming that one can implement LoggerFactory using log4j-over-slf4j which is somewhat surprising. -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=234 --- Comment #3 from Ceki Gulcu <listid@qos.ch> 2012-06-04 21:38:54 CEST --- Just looked at the code of owasp-esapi-java. It ships with a simple implementation of LoggerFactory returning instances of Log4JLogger (defined in owasp-esapi). -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=234 Ceki Gulcu <listid@qos.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #4 from Ceki Gulcu <listid@qos.ch> 2012-06-04 22:26:54 CEST --- Patch applied in http://github.com/ceki/slf4j/commit/7f888049bc -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (2)
-
bugzilla-daemon@pixie.qos.ch
-
bugzilla-daemon@qos.ch