- 调整日志级别
- Log Level:
ERROR
,WARN
,INFO
,DEBUG
, orTRACE
. - Logback does not have a
FATAL
level. It is mapped toERROR
. - The default log configuration echoes messages to the console as they are written. By default,
ERROR
-level,WARN
-level, andINFO
-level messages are logged. You can also enable a “debug” mode by starting your application with a--debug
flag. -
$ java -jar myapp.jar --debug
- Alternatively, you can enable a “trace” mode by starting your application with a
--trace
flag (ortrace=true
in yourapplication.properties
).
- Log Level:
- 日志文件
- By default, Spring Boot logs only to the console and does not write log files. If you want to write log files in addition to the console output, you need to set a
logging.file
orlogging.path
property (for example, in yourapplication.properties
). - Log files rotate when they reach 10 MB and, as with console output,
ERROR
-level,WARN
-level, andINFO
-level messages are logged by default. Size limits can be changed using thelogging.file.max-size
property. Previously rotated files are archived indefinitely unless thelogging.file.max-history
property has been set. - Logging properties are independent of the actual logging infrastructure. As a result, specific configuration keys (such as
logback.configurationFile
for Logback) are not managed by spring Boot.
- By default, Spring Boot logs only to the console and does not write log files. If you want to write log files in addition to the console output, you need to set a
Spring boot 官网学习笔记 - logging
猜你喜欢
转载自www.cnblogs.com/jiangtao1218/p/10204302.html
今日推荐
周排行