yml配置

#logging
logging.file: "logs/app.log"
logging:
  level:
    root: debug
  file:
    max-size: 10MB
    max-history: 20
  pattern:
    console: "%d %-5level %-40.40logger{39} [lineNo:%-4line] : %msg%n"
    file: "%d %-5level [%thread] %-40.40logger{39} [lineNo:%-4line] : %msg%n"

使用

private final Logger logger = LoggerFactory.getLogger(this.getClass());
public void test(){
    logger.error("The username or password isn't correct.");
}

相关文章:

  • 2021-07-09
  • 2021-05-03
  • 2021-10-25
  • 2021-05-18
  • 2022-12-23
  • 2021-09-03
猜你喜欢
  • 2021-06-15
  • 2021-08-05
  • 2021-12-05
  • 2021-12-12
  • 2021-07-12
  • 2021-10-28
  • 2021-04-20
相关资源
相似解决方案