使用 spring-boot 1.2.3.RELEASE。
让 spring-boot 登录到特定目录的唯一方法是像这样设置“log.file”属性:
logging.file=/var/log/app.log
但据我所知,according to the docs ,我应该这样做:
logging.file=app.log
logging.path=/var/log
但它似乎并没有监听 logging.path 属性,它只会将文件写入当前目录。
是文档有误还是我在这里遗漏了一些非常明显的东西?
另外,有了这个设置,它仍然可以正常滚动日志,对吧?
最佳答案
来自文档:
If you want to write log files in addition to the console output you need to set a logging.file or logging.path property
Spring boot 考虑 file
或 path
属性,而不是两者。
这个 page具有 file
和 path
属性的所有组合。
关于spring - 为什么 spring-boot 不监听 logging.path 变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29764258/