Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot app. Logger doesn't log DEBUG messages

I have application.yml with the following lines:

logging:
    file: logs/keyserver.log
    level:
        org.springframework.web: 'DEBUG'

It works ok except this case:

public class TransactionBuilder extends Wallet {

    private final Logger LOG = LoggerFactory.getLogger(TransactionBuilder.class);

    @Override
    public RedeemData findRedeemDataFromScriptHash(byte[] payToScriptHash) {
        LOG.debug("payToScriptHash = " + HEX.encode(payToScriptHash));
    }

}

The messages is appeared neither in log file nor on the screen.

However

LOG.info("payToScriptHash = " + HEX.encode(payToScriptHash));
LOG.error("payToScriptHash = " + HEX.encode(payToScriptHash));

works just fine.

like image 254
PaintedRed Avatar asked Mar 16 '23 04:03

PaintedRed


1 Answers

I assume that your class TransactionBuilder is not in the org.springframework.web package. Just add your package to the logging section of your configuration:

logging:
    file: logs/keyserver.log
    level:
        org.springframework.web: 'DEBUG'
        your.package: 'DEBUG'
like image 121
stevecross Avatar answered Mar 18 '23 21:03

stevecross