One of my Spring Boot applications makes problems during its Maven test phase.
Both during testing and "regular" application runtime, the Spring Boot application uses a logback configuration file very similar to src/main/resources/logback-spring.xml
. This configuration file (transitively) includes the logback configuration files base.xml
and file-appender.xml
. These configuration files set a logback property LOG_FILE=/tmp/spring.log
.
I guess it is best practice that file /tmp/server.log
is owned by user and group ${MY_SPRING_BOOT_APPLICATION}
.
Jenkins runs as user jenkins
. jenkins
does not have write permissions for /tmp/server.log
. Therefore the JUnit tests fail when executed by Jenkins.
- What is the best way to configure logging so that it works well during a Jenkins build-with-tests and so that it sets up daily rolling logging when leveraging Spring Boot's SysV init.d service functionality (which puts logs into
/var/log/
)? - Will file
/tmp/spring.log
be modified (and therefore be broken) concurrently if there are two or more Spring Boot applications running at the same time?