We (@dukecon) are trying out spring-boot 1.3.0.RC1 and see the file /tmp/spring.log (or better ${TMPDIR}/spring.log) created every time the application starts as in #303 and #381.
Just check out https://github.com/dukecon/dukecon_server and run the Spring Boot application in impl/target.
I tried upgrading to Boot 1.3.0.RC1, building then running java -jar dukecon-server-springboot-1.0.0-SNAPSHOT.war from /impl/target/ but I'm not seeing a log file in /tmp. I've also tried with the latest snapshot and I'm not seeing anything get created.
Can you double check that the file on your system isn't lying around from a previous run? Can you also tell me the exact steps you are using to run the app?
Well, the problem occurs in the develop branch (which is already on Boot 1.3.0.RC1). To reproduce I set up a new Vagrant box, with Ubuntu 14.04.3, Maven 3.2.5 and Oracle JDK 1.8. Then I did the following in the box
mkdir wrk
cd wrk
git clone -b develop ssh://[email protected]/dukecon/dukecon_server
cd dukecon_server/
mvn clean package
ls -l /tmp/spring.log
Then the file was there (I guess created by the tests already).
I run the same with strace and detected that the file /tmp/spring.log is created the first time after reading _something_ from /home/vagrant/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar (it seems to read the class ch.qos.logback.core.util.FileUtil, at least there were some unsuccessful stat attempts to find the class in other directories of the classpath read before). Then the file is closed and re-opened after some time).
The first lines of the file are
2015-11-15 10:16:57.144 INFO --- [main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [org.dukecon.server.filter.FiltersRepositorySpec]: no resource found for suffixes {-context.xml, Context.groovy}.
2015-11-15 10:16:57.191 INFO --- [main] o.s.t.c.web.WebTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.boot.test.IntegrationTestPropertiesListener@45018215, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@65d6b83b, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@d706f19, org.springframework.test.context.support.DirtiesContextTestExecutionListener@30b7c004, org.springframework.test.context.transaction.TransactionalTestExecutionListener@79efed2d, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@2928854b]
2015-11-15 10:16:57.214 INFO --- [main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [org.dukecon.server.favorite.FavoritesRepositorySpec]: no resource found for suffixes {-context.xml, Context.groovy}.
And it is created after starting the sure fire tests from the time stamps I see in the Maven output.
It's Spock that's triggering initialisation of Logback and the creation of spring.log. Denying write access to the file yields this exception when running mvn clean package:
at java.io.FileNotFoundException: /var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/spring.log (Permission denied)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:270)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:148)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:141)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:120)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:331)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
at at org.springframework.test.annotation.ProfileValueUtils.<clinit>(ProfileValueUtils.java:43)
at at org.spockframework.spring.SpringExtension.handleProfileValues(SpringExtension.java:95)
at at org.spockframework.spring.SpringExtension.visitSpec(SpringExtension.java:56)
at at org.spockframework.runtime.ExtensionRunner.runGlobalExtensions(ExtensionRunner.java:46)
at at org.spockframework.runtime.ExtensionRunner.run(ExtensionRunner.java:40)
at at org.spockframework.runtime.Sputnik.runExtensionsIfNecessary(Sputnik.java:88)
at at org.spockframework.runtime.Sputnik.run(Sputnik.java:61)
at at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Same problem when running the executable war file:
$ java -jar impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war
15:42:29,373 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
15:42:29,374 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:42:29,374 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/classes!/logback.xml]
15:42:29,391 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@cd5ef73 - URL [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/classes!/logback.xml] is not of type file
15:42:29,429 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
15:42:29,434 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[]] every 60 seconds.
15:42:29,434 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
15:42:29,445 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5cf1430f - Adding [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/base.xml] to configuration watch list.
15:42:29,445 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@cd5ef73 - URL [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/base.xml] is not of type file
15:42:29,447 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5cf1430f - Adding [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/defaults.xml] to configuration watch list.
15:42:29,447 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@cd5ef73 - URL [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/defaults.xml] is not of type file
15:42:29,449 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word clr with class [org.springframework.boot.logging.logback.ColorConverter]
15:42:29,449 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wex with class [org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter]
15:42:29,449 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wEx with class [org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter]
15:42:29,453 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [org.springframework.boot.logging.logback.LevelRemappingAppender]
15:42:29,454 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [DEBUG_LEVEL_REMAPPER]
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.startup.DigesterFactory] to ERROR
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.catalina.util.LifecycleBase] to ERROR
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.coyote.http11.Http11NioProtocol] to WARN
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.sshd.common.util.SecurityUtils] to WARN
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.tomcat.util.net.NioSelectorPool] to WARN
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.crsh.plugin] to WARN
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.crsh.ssh] to WARN
15:42:29,475 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.eclipse.jetty.util.component.AbstractLifeCycle] to ERROR
15:42:29,476 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate.validator.internal.util.Version] to WARN
15:42:29,476 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration] to WARN
15:42:29,476 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [org.springframework.boot.actuate.endpoint.jmx] to false
15:42:29,476 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DEBUG_LEVEL_REMAPPER] to Logger[org.springframework.boot.actuate.endpoint.jmx]
15:42:29,476 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [org.thymeleaf] to false
15:42:29,476 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [DEBUG_LEVEL_REMAPPER] to Logger[org.thymeleaf]
15:42:29,477 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5cf1430f - Adding [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/console-appender.xml] to configuration watch list.
15:42:29,477 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@cd5ef73 - URL [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/console-appender.xml] is not of type file
15:42:29,478 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
15:42:29,480 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
15:42:29,489 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
15:42:29,523 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@5cf1430f - Adding [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/file-appender.xml] to configuration watch list.
15:42:29,523 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@cd5ef73 - URL [jar:file:/Users/awilkinson/dev/temp/dukecon_server/impl/target/dukecon-server-springboot-1.1.0-SNAPSHOT.war!/WEB-INF/lib/spring-boot-1.3.0.RELEASE.jar!/org/springframework/boot/logging/logback/file-appender.xml] is not of type file
15:42:29,524 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
15:42:29,527 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
15:42:29,532 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
15:42:29,541 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@5c7683bb - No compression will be used
15:42:29,548 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T//spring.log
15:42:29,548 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T//spring.log]
15:42:29,549 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T//spring.log,true) call failed. java.io.FileNotFoundException: /var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/spring.log (Permission denied)
at java.io.FileNotFoundException: /var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/spring.log (Permission denied)
at at java.io.FileOutputStream.open0(Native Method)
at at java.io.FileOutputStream.open(FileOutputStream.java:270)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:148)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:152)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:140)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:119)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:328)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:280)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
at at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:181)
at at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
at at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
at at org.springframework.boot.SpringApplication$run.call(Unknown Source)
at at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
at at org.dukecon.DukeConServerApplication.main(DukeConServerApplication.groovy:20)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:497)
at at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at at java.lang.Thread.run(Thread.java:745)
@ascheman I believe that this is working as designed. Your logback.xml file is importing Boot's base.xml file. It defines the LOG_FILE property:
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}spring.log}"/>
It also imports file-appender.xml which contains the following:
<included>
<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${LOG_FILE}.%i</fileNamePattern>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>10MB</MaxFileSize>
</triggeringPolicy>
</appender>
</included>
It's created a file appender that will write to ${LOG_FILE} which is spring.log in the temp directory.
Your own logback.xml defines its own console and file appenders so I doubt that you want the ones declared via Boot's base.xml as well. The simplest solution to your problem is to delete the import of base.xml from your logback.xml file. With that change in place your app starts for me, even without write access to spring.log.
This issue is still happening in 1.3.1 and 1.3.2.
Here are the details of what I was able to find so far:
OSX: When deployed in OSX it works just fine. Only one logback file is generated when using logging.file in application.properties.
RHEL/CentOS 6.7: When deployed in Linux (Red Hat Enterprise Linux Server release 6.7 or CentOS 6.7), the extra file is generated. The best solution I found so far was to remove the logback.xml file from classpath and pass it at command line: java -jar spring-boot-app.jar --logging.config=./logback.xml. This prevents a second log file from being generated.
@bmsantos This issue was closed as invalid as it turned out to be due to a configuration error in the user's logback.xml. If you believe you've found a similar problem that isn't due to a configuration error, please open a new issue with a small sample application that reproduces the problem.
@wilkinsona Thanks! A new issue with sample project as been added. See #5124.
<property name="LOG_FILE" value="/$YourDir/spring.log"/>
must before
<include> tag to set this variable . avoid you no privilege access /tmp directory .
Including a property in your config file makes it a bit hardcoded and you have to change the file for each environment you deploy to. What worked for me is just setting LOG_FILE in the OS environment for each application I want to run.
export LOG_FILE='/path/to/my/log/file'
java -jar my_app.jar
(Spring 1.3.3, Ubuntu 16, Java 8u122)
In your logback.xml try following lines:
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<appender name="dailyRollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./logs/app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>./logs/app.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern>
</encoder>
</appender>
<appender name="consoleRolling" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<logger name="com.app" level="DEBUG"
additivity="false">
<appender-ref ref="dailyRollingFile"/>
<appender-ref ref="consoleRolling"/>
</logger>
<root level="INFO">
<appender-ref ref="dailyRollingFile"/>
<appender-ref ref="consoleRolling"/>
</root>
Most helpful comment
Including a property in your config file makes it a bit hardcoded and you have to change the file for each environment you deploy to. What worked for me is just setting LOG_FILE in the OS environment for each application I want to run.
export LOG_FILE='/path/to/my/log/file'java -jar my_app.jar(Spring 1.3.3, Ubuntu 16, Java 8u122)