问题
I have configured the logging path property in my spring boot application.properties.
logging.path=
logging.file=
In respective of this property in application.properties. It is taking the logging file name and creating a new log file in tomcat log file directory.I checked my system properties it has set both LOG_FILE and LOG_PATH property. I have using 1.3.6 version of spring boot. Any known issue related to this. I have read one issue and it seems to be fixed long back.
回答1:
You can only use one of the two properties, either you set:
- the logging file name (
logging.file
); - or the path (
logging.path
).
You can't specify both at the same time.
Sources
Spring documentation is very subtle on this:
If you want to write log files in addition to the console output you need to set a
logging.file
ORlogging.path
property.
springframework.guru says this:
There is also a logging.path property to specify a path for a logging file. If you use it, Spring Boot creates a spring.log file in the specified path. However, you cannot specify both the logging.file and logging.path properties together. If done, Spring Boot will ignore both.
来源:https://stackoverflow.com/questions/39268242/spring-boot-logging-path