SpringBoot 日志配置

springboot日志配置 logging.path logging.file 注意事项

可能有些童靴会同时配置 logging.path 和 logging.file,但是又发现其中一个不生效。

官方文档中有这么一句:

If you want to write log files in addition to the console output you
need to set a logging.file or logging.path property
也就是说,它们不会同时生效,只配置其中一个就好了。

例如我配置的时候只指定 path

logging.path = ./logs

那么就会在项目工程中创建一个 logs 文件夹,并且记录日志的时候默认的文件名是 spring.log

作者:Binge
本文版权归作者和博客园共有,转载必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/binbingg/p/13854735.html