Logging in Java projects … Logback

Logging is as old as cave man writing on walls in Java community.

After using Log4j, SLF4J, today I got a opportunity to start using Logback.

It is very easy to use and configure. The features I liked much are as follows.

1. Default no configuration file required.

2. Option to merge different configuration files to one. (Inclusion of properties files)

3. Option to enable them quickly to check on web in web applications.

4. Supporting groovy style.

5. Better documentation. http://logback.qos.ch/manual/introduction.html

6. Developed by Log4j author. Assuming that he knows all the problems in Log4j and improved Logback a lot. Also a trusted source to use library.

for more check Logback site http://logback.qos.ch/index.html .

Only thing I didn’t like is the name “LogBack”.

-o-

Advertisements

Hibernate, JBoss, Log4j Logging

Question: How to enable Hibernate logging in JBoss?

<!-- Hibernate Logging -->
    <category name="org.hibernate">
        <priority value="ERROR" />
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE"/>
   </category>
    <category name="org.hibernate.SQL">
        <priority value="TRACE" />
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE"/>
   </category>
    <category name="org.hibernate.type">
        <priority value="TRACE" />
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE"/>
   </category>

-o-