快速配置日志方法
#log logging.file=logs/stdout.log logging.file.max-size=20KB logging.pattern.file=%date [%thread][IP:%X{ip}|USER:%X{user}][%-5level %logger{80}] %msg%n logging.pattern.console=%date [%thread][IP:%X{ip}|USER:%X{user}][%-5level %logger{80}] %msg%n logging.level.root=INFO logging.level.com.cff=DEBUG logging.level.org.springframework.web=INFO logging.level.org.hibernate=ERROR
log4j2快速配置
要使用log4j2,首先要排除已经依赖的spring-boot-starter-logging,然后手动引入spring-boot-starter-log4j2
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency>
#log logging.file=logs/stdout.log logging.file.max-size=20KB logging.pattern.file=%date [%thread][IP:%X{ip}|USER:%X{user}][%-5level %logger{80}] %msg%n logging.pattern.console=%date [%thread][IP:%X{ip}|USER:%X{user}][%-5level %logger{80}] %msg%n logging.level.root=INFO logging.level.com.cff=DEBUG logging.level.org.springframework.web=INFO logging.level.org.hibernate=ERROR
标签:logging,SpringBoot,level,spring,配置,boot,file,org,日志 From: https://www.cnblogs.com/porter/p/17602434.html