[slf4j-user] blog entry on JCL

Tim Vernum tim at adjective.org
Mon Feb 19 11:26:09 CET 2007


>> 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 :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Slf4jFilteringPatternLayout.java
Type: application/octet-stream
Size: 4812 bytes
Desc: not available
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20070219/71511c7f/attachment.obj>
-------------- next part --------------




More information about the slf4j-user mailing list