spring-boot provides several
logging.* settings that can be applied in
logging.level.=DEBUG logging.file=myfile.log logging.path=d:/logs/
myfile.log is generated, BUT inside the classpath! Why isn’t spring taking my absolute path into account?
The Spring Boot documentation states
By default, Spring Boot will only log to the console and will not write log files. If you want to write log files in addition to the console output you need to set a logging.file or logging.path property (for example in your application.properties).
and then describes how the
logging.path properties work. You should only set one.
logging.file is set, it will write to that specific file. The documentation states
Names can be an exact location or relative to the current directory.
So you’re likely writing to your current directory, which happens to be the same as your classpath.
If you set
logging.path, Spring Boot
spring.logto the specified directory. Names can be an exact location or relative to the current directory.
Check that your current directory isn’t your classpath, if you don’t want them to mix, and adapt one of the