Spring cloud configuration server starts without using logging.file property
See original GitHub issueI have an application that start a configuration server. It uses Spring-boot and Spring-cloud. I also use logback to write logs in a file. I use Spring-boot 1.3.7 and spring-cloud-config-server version Brixton.SR4. (Same problem with Brixton.SR3 and Brixton.RELEASE)
In the resources folder, I have this application.yml file :
server:
port: 8888
spring:
application:
name: geodis-configuration-server
cloud:
config:
server:
git:
uri: git://my-repository-url.git
searchPaths: runtime-configurations/dev,runtime-configurations/rct
logging:
file: D:/PathToLogFile/configuration-server.log
level:
ROOT: 'INFO'
config: classpath:logback-spring.xml
In the same folder, there is the logback-spring.xml :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE}-%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%date{YYYY-MM-dd HH:mm:ss} %level [%thread] %logger{10} %msg%n</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="INFO">
<appender-ref ref="FILE"/>
</logger>
<logger name="org.apache" level="INFO">
<appender-ref ref="FILE"/>
</logger>
</configuration>
My problem is when I start the configuration it start without using the logging.file property and write the first two log lines in a LOG_FILE_IS_UNDEFINED file. After this, it write the logs normally in the configuration-server.log file. I don’t understand why the first two lines are not written is the configuration-server.log file.
Here is the beggining of the logs when the server start :
2016-08-17 14:26:46 INFO [main] o.s.c.a.AnnotationConfigApplicationContext Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@52af26ee: startup date [Wed Aug 17 14:26:46 CEST 2016]; root of context hierarchy
2016-08-17 14:26:46 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e63d7b64] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
CONFIGURATION-SERVER
Application : my-configuration-server
Spring boot : (v1.3.7.RELEASE)
--------------------------------------------
2016-08-17 14:26:47 INFO [main] c.g.r.c.s.ConfigurationServer No active profile set, falling back to default profiles: default
2016-08-17 14:26:47 INFO [main] o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2a3c96e3: startup date [Wed Aug 17 14:26:47 CEST 2016]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@52af26ee
2016-08-17 14:26:48 WARN [main] o.s.c.a.ConfigurationClassPostProcessor Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-08-17 14:26:48 INFO [main] o.s.c.c.s.GenericScope BeanFactory id=725dcee0-eb42-375b-9cca-8fe922431dc2
2016-08-17 14:26:48 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e63d7b64] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-08-17 14:26:48 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration$$EnhancerBySpringCGLIB$$8f9c7d5a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-08-17 14:26:48 INFO [main] o.s.b.c.e.t.TomcatEmbeddedServletContainer Tomcat initialized with port(s): 8888 (http)
2016-08-17 14:26:48 INFO [main] o.a.c.c.StandardService Starting service Tomcat
2016-08-17 14:26:48 INFO [main] o.a.c.c.StandardEngine Starting Servlet Engine: Apache Tomcat/8.0.36
2016-08-17 14:26:49 INFO [localhost-startStop-1] o.a.c.c.C.[.[.[/] Initializing Spring embedded WebApplicationContext
2016-08-17 14:26:49 INFO [localhost-startStop-1] o.s.w.c.ContextLoader Root WebApplicationContext: initialization completed in 1940 ms
2016-08-17 14:26:49 INFO [localhost-startStop-1] o.s.b.c.e.ServletRegistrationBean Mapping servlet: 'dispatcherServlet' to [/]
The lines before the banner (first two line) are in the LOG_FILE_IS_UNDEFINED file.
How can I solve this issue ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (5 by maintainers)
If you use
logback-spring.xml
I believe you have to define all the properties you need in that file inbootstrap.yml
because it is initialized earlier.No problem with Finchley.RELEASE. The issue seems fixed.