0

I want to false the condition for " logger.isDebugEnabled()" in Groovy

this is my code.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.PropertyResolver;

public class Sample{
    private static final Logger logger = LoggerFactory.getLogger(Sample.class);


    public void checkcode(String scope) {

        if (logger.isDebugEnabled()) {
            logger.debug("some message ");
        }

    }
}
sajeeth
  • 47
  • 2
  • 9
  • it depends on logger provider that you are using behind slf4j. for example if you are using log4j - normally you could set log level with log4j.properties file. – daggett May 29 '22 at 21:53
  • for **slf4j ** bro – sajeeth May 30 '22 at 12:03
  • 1
    slf4j itself is just a facade for a real logger. the only logger provider in slf4j - slf4j-simple - https://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html parameters could set through system properties or through simplelogger.properties – daggett May 30 '22 at 13:40

0 Answers0