[slf4j-user] How to use Debug....

Jipeng Tan tan1986 at gmail.com
Thu Oct 18 07:32:18 CEST 2007


This is my testing code:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Wombat {

    final Logger logger = LoggerFactory.getLogger(Wombat.class);

    Integer t;

    Integer oldT;

    public void setTemperature(Integer temperature) {

        oldT = t;
        t = temperature;

        logger.debug("Temperature set to {}. Old temperature was {}.", t,
oldT);

        System.out.println(logger.isDebugEnabled());

        if (temperature.intValue() > 50) {
            logger.info("Temperature has risen above 50 degrees.");
        }
    }

    public static void main(String[] args) {

        Wombat wombat = new Wombat();

        wombat.setTemperature(1);

        wombat.setTemperature(55);
    }
}



Sadly, the output only have the information with log.info, nothing about
logger.debug, and the output of (logger.isDebugEnabled()) is also false, can
anyone tell me how to use debug??? Thanks a lot!@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20071018/a30e1c3c/attachment.htm>


More information about the slf4j-user mailing list