Situation
- I use
spring-boot-maven-plugin
to create executablejar
package of my Spring Boot application. Application is at server (Ubuntu) managed viainit.d
service:
/etc/init.d/{appname} start|stop
- I use
Log4j
RollingFile
appender to create hourly log files (application.%d{yyyy-MM-dd-HH}.log.gz
) located in my application directory.
Problem
There is a duplicated application log file located in /var/log/{appname}.log
.
Question
How do not create duplicated log file in /var/log
?
log4j.xml
<RollingFile name="appFileAppender" fileName="./logs/application.log" filePattern="application.%d{yyyy-MM-dd-HH}.log.gz">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} %X{correlationId} - %msg%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
</Policies>
</RollingFile>
File pom.xml
is not connected to this issue in any way.