简体   繁体   中英

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.

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM