LogBack Logger Addon for Roo

DZone 's Guide to

LogBack Logger Addon for Roo

· Java Zone ·
Free Resource
Want faster, flexible & more robust logging? Have you looked at LogBack by the creator of Log4J yet? Introducing the LogBack Addon for Roo


  1. Adds the command to the Roo shell – logback setup
  2. Creates a New File: src/main/resources/logback.xml
  3. Changes to Maven POM:
    • new <property> “logback.version”
    • dependencies for logback-core, access, classic
    • java util logging and jakarta commons logging bridges
  4. Removed dependency: slf4j-log4j
  5. Logging in Your Code:
    1. Import the SLF4J Logger classes
      import org.slf4j.Logger;
      import org.slf4j.LoggerFactory;
      Declare the logger
      public class MyClass {
      Logger logger = LoggerFactory.getLogger(MyClass.class);

    2. Write your log statements as desired
      logger.debug("****** YOUR DEBUG MESSAGE ******"); 

Source code in Git:

git clone git://github.com/gordonad/logback-roo-addon.git

From http://gordondickens.com/wordpress/2010/11/10/logback-logger-addon-for-roo/


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}