I have a Spring boot app that logs perfectly to the file system (via logging.level/logging.file properties) when run from the commandline with:
java -jar jarfilename.jar
However, when I put the following in my pom.xml in order to create an executable JAR and then attempt to run it as an init script in Ubuntu, the logging doesn't happen at all.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
Here are the commands I'm running on Linux:
ln -s /path/to/executablejar.jar /etc/init.d/myapp
chmod a+x /etc/myapp
/etc/init.d/myapp start
I imagine this must be some sort of problem with the logging configuration not accounting for the way in which the executable jar is being launched, but I'm puzzled and would appreciate any guidance.
Here is my logging setup in application.properties:
logging.level.org.springframework=error
logging.level.com.myapp=debug
logging.level.org.hibernate=error
logging.file=/path/to/a.log