The disappearing location info problem has been previously reported [1].
Unfortunately, since there are two indirections involved
(jcl->slf4j->log4j), it is not possible to correctly compute the location
information.

[1] http://bugzilla.slf4j.org/show_bug.cgi?id=23

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
       <layout class="org.apache.log4j.PatternLayout">
           <param name="ConversionPattern"
               value="%p [%t] %c{1}.%M(%L) | %m%n"/>
       </layout>
   </appender>

Sorry I'm so late coming into this - we hit an unexpected storm season over here, and it sucked up a bit of my time.

There is a solution to this, but it's somewhat of a hack. It does appear to work though (from my limited testing).

You could try using the attached layout, with your appender configured like this:
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<layout class="org.adjective.useful.log4j.Slf4jFilteringPatternLayout">
           <param name="ConversionPattern"
               value="%p [%t] %c{1}.%M(%L) | %m%n"/>
       </layout>
   </appender>

As I said, it's a bit of a hack, but that's the travesty of commons- logging :)

Attachment: Slf4jFilteringPatternLayout.java
Description: Binary data



_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user

Reply via email to