Spring Boot - no log file written (logging.file is not respected)

Christoph Möbius picture Christoph Möbius · Jul 22, 2016 · Viewed 59.1k times · Source

I use Spring Boot and want it to write log output to a file.

According to the docs, this is simply done by setting

logging.file=filename.log

While the console output works fine, filename.log is not created. Also, if I create the file manually, nothing is written to it. What do I miss?

Answer

Vivek Raja picture Vivek Raja · Jul 13, 2020

Use logging.file.name instead of logging.file

In higher versions of spring-boot-parent(from version 2.2.0), property logging.file is deprecated.