Spring boot logging path

岁酱吖の 提交于 2019-12-11 08:07:11

问题


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 OR logging.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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!