Spring Boot 配置log

1. application.properties
logging.level.xxx.xxx.包=DEBUG
2. 代码中使用
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...
public HelloController {
  private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class);
  ...
  LOGGER.debug("xxxxx debug");
  LOGGER.error("xxxxx error");
}

你可能感兴趣的:(Spring Boot 配置log)