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
<
I just used the Spring-boot provided logging mechanism. I wrote below in my 'logback.xml' file :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/file- appender.xml" />
<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>
I put the both application.properties and logback.xml file under same package 'src/main/resources'. In application.properties file just added one parameter :
logging.file = xyz.log
It worked perfectly fine for me.
In my case, I added a file "logback.xml" in one of my sub module by mistake which caused this issue, remove it and everything will be fine.
I was also facing same issues, since i just copied the path as windows(uses "\" in path) provide.
Fixed just by changing : back slash ("\") to forward slash ("/") in path.
Note: Strictly forward slash ("/") should be used in path, OS is not the constraint.
ex:- logging.file.name=D:/Logs/server.log