[slf4j-user] blog entry on JCL

Matt Raible mraible at gmail.com
Mon Feb 5 21:51:00 CET 2007


Is the solution to replace all my application's org.apache.commons
imports with slf4j imports?  Is so, I can do that.  However, will the
other libraries (i.e. Spring and Hibernate) continue to have this
missing location issue when I try to turn up the logging on them?

Thanks,

Matt

On 2/5/07, Ceki Gülcü <listid at qos.ch> wrote:
>
> I am glad to hear that it is beginning to work.
>
> 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
>
>
> At 09:25 PM 2/5/2007, Matt Raible wrote:
>
>  >Thanks - that works!  However, I'd expect the logging to look the same
>  >as it did before.  Unfortunately, it looks like the method isn't
>  >printed out - just "info", "debug", etc.  Here's my log4j.xml
>  >configuration:
>  >
>  >    <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>
>  >
>  >commons-logging:
>  >
>  >WARN [main] UserAction.save(157) | User 'tomcat' already exists!
>  >INFO [main] UserActionTest.endTransaction(284) | Rolled back
>  >transaction after test execution
>  >INFO [main] UserActionTest.startNewTransaction(318) | Began
>  >transaction (1): transaction manager
>  >[org.springframework.orm.hibernate3.HibernateTransactionManager at 77cd4a];
>  >default rollback = true
>  >INFO [main] UserActionTest.endTransaction(284) | Rolled back
>  >transaction after test execution
>  >INFO [main] UserActionTest.startNewTransaction(318) | Began
>  >transaction (1): transaction manager
>  >[org.springframework.orm.hibernate3.HibernateTransactionManager at 77cd4a];
>  >default rollback = true
>  >DEBUG [main] UserManagerImpl.removeUser(66) | removing user: 2
>  >INFO [main] UserActionTest.endTransaction(284) | Rolled back
>  >transaction after test execution
>  >
>  >SLF4J:
>  >
>  >WARN [main] UserAction.warn(139) | User 'tomcat' already exists!
>  >INFO [main] UserActionTest.info(118) | Rolled back transaction after
>  >test execution
>  >INFO [main] UserActionTest.info(118) | Began transaction (1):
>  >transaction manager
>  >[org.springframework.orm.hibernate3.HibernateTransactionManager at f4b30a];
>  >default rollback = true
>  >INFO [main] UserActionTest.info(118) | Rolled back transaction after
>  >test execution
>  >INFO [main] UserActionTest.info(118) | Began transaction (1):
>  >transaction manager
>  >[org.springframework.orm.hibernate3.HibernateTransactionManager at f4b30a];
>  >default rollback = true
>  >DEBUG [main] UserManagerImpl.debug(97) | removing user: 2
>  >INFO [main] UserActionTest.info(118) | Rolled back transaction after
>  >test execution
>  >
>  >Thanks,
>
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for Java.
> http://logback.qos.ch
>
> _______________________________________________
> user mailing list
> user at slf4j.org
> http://www.slf4j.org/mailman/listinfo/user
>


-- 
http://raibledesigns.com


More information about the slf4j-user mailing list