Spring 云客户端存在远程日志记录配置问题
Spring cloud client with remote logging config problems
我的基础架构很简单,我有一个 git 服务器、一个 spring 云配置服务器和一个从配置服务器和 git 获取配置的微服务。
我从 app-name:
得到这个配置文件
server:
port: 8893
logging:
config: http://xxx.xx.xx.xx:3000/admin123/config-repository/raw/master/log4j2.xml
还有我的 log4j2 配置 xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="all" name="MyApp" packages="">
<Appenders>
<Syslog name="RFC5424" format="RFC5424" host="xxx.xx.xx.75" port="514"
protocol="TCP" appName="MyApp" mdcId="mdc" includeMDC="true"
facility="SYSLOG" enterpriseNumber="18060" newLine="true" messageId="Audit" id="App"
reconnectionDelayMillis="100000">
</Syslog>
<Async name="Async">
<AppenderRef ref="RFC5424" />
</Async>
</Appenders>
<Loggers>
<Logger name="com.mycorp" level="all">
<AppenderRef ref="Async" />
</Logger>
<Root level="all">
<AppenderRef ref="Async" />
</Root>
</Loggers>
</Configuration>
问题是应用程序开始记录系统日志,然后开始记录到控制台,但停止写入系统日志。
因此,log4j 配置与应用程序配置一起读取,但中间发生了一些事情。
就像日志配置仅适用于应用程序的 bootstrap 一样。
我做了一些本地测试,我知道 looging.config 必须放在 application.yml 上,而不是放在 bootstrap.yml 上,如果我这样做,我会得到相同的结果。
也许我否认了一些概念。
这是系统日志的最后一部分:
hod.annotation.ModelAttributeMethodProcessor@3cfdd348] supports [class org.springframework.cloud.config.environment.Environment]
2015-10-07T20:16:05+00:00 ip 1 2015-10-07T17:17:20.465-03:00 rMyName MyApp - Audit - Testing if return value handler [org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor@449591d4] supports [class org.springframework.cloud.config.environment.Environment]
2015-10-07T20:16:05+00:00 ip 1 2015-10-07T17:17:20.469-03:00 rMyName MyApp - Audit - Written [Environment [name=micro-central-get-ticket, profiles=[default], label=master, propertySources=[PropertySource [name=classpath:/config/micro-central-get-ticket.yml]]]] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@4e3a58ee]
2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@5469414b
2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Successfully completed request
2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4d0b0fd4: ServletRequestHandledEvent: url=[/micro-central-get-ticket/default]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; time=[618967ms]; status=[OK]
2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Publishing event in org.springframework.context.annotation.AnnotationConfigApplicationContext@34f7234e: ServletRequestHandledEvent: url=[/micro-central-get-ticket/default]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; time=[618967ms]; status=[OK]
控制台上写着日志:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
[2015-10-08 11:01:43.803] boot - 6488 INFO [main] --- CentralGetTicketApplication: Starting CentralGetTicketApplication on rMyName with PID 6488 (C:\workspaces\microservicios-quini6-v3\micro-central-get-ticket-test\target\classes started by rMyName in C:\workspaces\microservicios-quini6-v3\micro-central-get-ticket-test)
[2015-10-08 11:01:43.847] boot - 6488 INFO [main] --- AnnotationConfigApplicationContext: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6: startup date [Thu Oct 08 11:01:43 GMT-03:00 2015]; root of context hierarchy
[2015-10-08 11:01:43.980] boot - 6488 INFO [main] --- AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[2015-10-08 11:01:44.192] boot - 6488 INFO [main] --- CentralGetTicketApplication: Started CentralGetTicketApplication in 3.049 seconds (JVM running for 3.869)
[2015-10-08 11:03:07.221] boot - 6488 INFO [main] --- PropertySourceBootstrapConfiguration: Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='classpath:/config/micro-central-get-ticket.yml']]]
[2015-10-08 11:03:07.244] boot - 6488 INFO [main] --- AnnotationConfigEmbeddedWebApplicationContext: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64f555e7: startup date [Thu Oct 08 11:03:07 GMT-03:00 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6
[2015-10-08 11:03:07.983] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
[2015-10-08 11:03:08.103] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'infoEndpoint': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration; factoryMethodName=infoEndpoint; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointAutoConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$InfoEndpointRebinderConfiguration; factoryMethodName=infoEndpoint; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/autoconfigure/RefreshAutoConfiguration$InfoEndpointRebinderConfiguration.class]]
[2015-10-08 11:03:08.125] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'default.null.RibbonClientSpecification': replacing [Generic bean: class [org.springframework.cloud.netflix.ribbon.RibbonClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.cloud.netflix.ribbon.RibbonClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
[2015-10-08 11:03:08.263] boot - 6488 INFO [main] --- GenericScope: BeanFactory id=2ee54948-4ea0-303c-9a4e-7ecb6a22bf0b
[2015-10-08 11:03:08.269] boot - 6488 INFO [main] --- AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[2015-10-08 11:03:08.288] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.scheduling.annotation.SchedulingConfiguration' of type [class org.springframework.scheduling.annotation.SchedulingConfiguration$$EnhancerBySpringCGLIB$b077a16] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.410] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ab1f6fb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.426] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'transactionAttributeSource' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.435] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'transactionInterceptor' of type [class org.springframework.transaction.interceptor.TransactionInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.442] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.config.internalTransactionAdvisor' of type [class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.472] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$ConfigurationPropertiesRebinderConfiguration' of type [class org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$ConfigurationPropertiesRebinderConfiguration$$EnhancerBySpringCGLIB$$fbb4e411] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[2015-10-08 11:03:08.725] boot - 6488 INFO [main] --- TomcatEmbeddedServletContainer: Tomcat initialized with port(s): 8893 (http)
[2015-10-08 11:03:08.839] boot - 6488 INFO [main] --- StandardService: Starting service Tomcat
[2015-10-08 11:03:08.840] boot - 6488 INFO [main] --- StandardEngine: Starting Servlet Engine: Apache Tomcat/8.0.20
[2015-10-08 11:03:08.962] boot - 6488 INFO [localhost-startStop-1] --- [/]: Initializing Spring embedded WebApplicationContext
[2015-10-08 11:03:08.963] boot - 6488 INFO [localhost-startStop-1] --- ContextLoader: Root WebApplicationContext: initialization completed in 1719 ms
[2015-10-08 11:03:09.528] boot - 6488 INFO [localhost-startStop-1] --- ServletRegistrationBean: Mapping servlet: 'dispatcherServlet' to [/]
[2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'metricFilter' to: [/]
[2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'characterEncodingFilter' to: [/]
[2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'webRequestLoggingFilter' to: [/]
[2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/]
[2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'applicationContextIdFilter' to: [/*]
[2015-10-08 11:03:09.957] boot - 6488 WARN [main] --- URLConfigurationSource: No URLs will be polled as dynamic configuration sources.
[2015-10-08 11:03:09.957] boot - 6488 INFO [main] --- URLConfigurationSource: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
[2015-10-08 11:03:09.965] boot - 6488 INFO [main] --- DynamicPropertyFactory: DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@734ce281
[2015-10-08 11:03:10.269] boot - 6488 INFO [main] --- RequestMappingHandlerAdapter: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64f555e7: startup date [Thu Oct 08 11:03:07 GMT-03:00 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6
[2015-10-08 11:03:10.328] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/],methods=[POST],params=[],headers=[],consumes=[application/json],produces=[application/json],custom=[]}" onto public ar.com.boldt.common.business.model.response.central.TicketInfoResponse ar.com.boldt.getticket.controller.GetTicketController.obtenerTicket(ar.com.boldt.common.business.model.request.central.TicketInfoRequest)
[2015-10-08 11:03:10.330] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
[2015-10-08 11:03:10.330] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
[2015-10-08 11:03:10.365] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2015-10-08 11:03:10.365] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2015-10-08 11:03:10.421] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
[2015-10-08 11:03:11.014] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/shutdown],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.ShutdownMvcEndpoint.invoke()
[2015-10-08 11:03:11.015] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/restart],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke()
[2015-10-08 11:03:11.015] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map)
[2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env/reset],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset()
[2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env/{name:.}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
[2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/health],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal)
[2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/mappings],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/pause],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/metrics/{name:.}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/metrics],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/refresh],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/resume],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke()
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/configprops],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/archaius],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/autoconfig],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/beans],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/dump],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/trace],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
[2015-10-08 11:03:11.157] boot - 6488 WARN [main] --- URLConfigurationSource: No URLs will be polled as dynamic configuration sources.
[2015-10-08 11:03:11.157] boot - 6488 INFO [main] --- URLConfigurationSource: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
[2015-10-08 11:03:11.174] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Registering beans for JMX exposure on startup
[2015-10-08 11:03:11.206] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'refreshEndpoint' has been autodetected for JMX exposure
[2015-10-08 11:03:11.206] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'restartEndpoint' has been autodetected for JMX exposure
[2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure
[2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'refreshScope' has been autodetected for JMX exposure
[2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'environmentManager' has been autodetected for JMX exposure
[2015-10-08 11:03:11.210] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager]
[2015-10-08 11:03:11.224] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint]
[2015-10-08 11:03:11.236] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope]
[2015-10-08 11:03:11.244] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,type=ConfigurationPropertiesRebinder]
[2015-10-08 11:03:11.252] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.bootstrap.config:name=refreshEndpoint,type=RefreshEndpoint]
[2015-10-08 11:03:11.255] boot - 6488 INFO [main] --- DefaultLifecycleProcessor: Starting beans in phase 0
[2015-10-08 11:03:11.258] boot - 6488 INFO [main] --- EurekaConfigBasedInstanceInfoProvider: Setting initial instance status as: STARTING
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Disable delta property : false
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Single vip registry refresh property : null
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Force full registry fetch : false
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Application is null : false
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Registered Applications size is zero : true
[2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Application version is -1: true
[2015-10-08 11:03:12.721] boot - 6488 ERROR [main] --- DiscoveryClient: Can't get a response from http://xxx.xx.xxx.57:8761/eureka/apps/
它永远不会工作,spring 引导文档允许您使用 logging.config 仅将配置文件作为参数传递给 jar,例如,如果您可以使用它编写 url 到您的配置中,spring 以覆盖值启动,并将使用控制台日志记录方式。
我的基础架构很简单,我有一个 git 服务器、一个 spring 云配置服务器和一个从配置服务器和 git 获取配置的微服务。 我从 app-name:
得到这个配置文件server:
port: 8893
logging:
config: http://xxx.xx.xx.xx:3000/admin123/config-repository/raw/master/log4j2.xml
还有我的 log4j2 配置 xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="all" name="MyApp" packages="">
<Appenders>
<Syslog name="RFC5424" format="RFC5424" host="xxx.xx.xx.75" port="514"
protocol="TCP" appName="MyApp" mdcId="mdc" includeMDC="true"
facility="SYSLOG" enterpriseNumber="18060" newLine="true" messageId="Audit" id="App"
reconnectionDelayMillis="100000">
</Syslog>
<Async name="Async">
<AppenderRef ref="RFC5424" />
</Async>
</Appenders>
<Loggers>
<Logger name="com.mycorp" level="all">
<AppenderRef ref="Async" />
</Logger>
<Root level="all">
<AppenderRef ref="Async" />
</Root>
</Loggers>
</Configuration>
问题是应用程序开始记录系统日志,然后开始记录到控制台,但停止写入系统日志。 因此,log4j 配置与应用程序配置一起读取,但中间发生了一些事情。 就像日志配置仅适用于应用程序的 bootstrap 一样。 我做了一些本地测试,我知道 looging.config 必须放在 application.yml 上,而不是放在 bootstrap.yml 上,如果我这样做,我会得到相同的结果。 也许我否认了一些概念。
这是系统日志的最后一部分:
hod.annotation.ModelAttributeMethodProcessor@3cfdd348] supports [class org.springframework.cloud.config.environment.Environment] 2015-10-07T20:16:05+00:00 ip 1 2015-10-07T17:17:20.465-03:00 rMyName MyApp - Audit - Testing if return value handler [org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor@449591d4] supports [class org.springframework.cloud.config.environment.Environment] 2015-10-07T20:16:05+00:00 ip 1 2015-10-07T17:17:20.469-03:00 rMyName MyApp - Audit - Written [Environment [name=micro-central-get-ticket, profiles=[default], label=master, propertySources=[PropertySource [name=classpath:/config/micro-central-get-ticket.yml]]]] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@4e3a58ee] 2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling 2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@5469414b 2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Successfully completed request 2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4d0b0fd4: ServletRequestHandledEvent: url=[/micro-central-get-ticket/default]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; time=[618967ms]; status=[OK] 2015-10-07T20:18:40+00:00 ip 1 2015-10-07T17:19:55.118-03:00 rMyName MyApp - Audit - Publishing event in org.springframework.context.annotation.AnnotationConfigApplicationContext@34f7234e: ServletRequestHandledEvent: url=[/micro-central-get-ticket/default]; client=[127.0.0.1]; method=[GET]; servlet=[dispatcherServlet]; session=[null]; user=[null]; time=[618967ms]; status=[OK]
控制台上写着日志:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. [2015-10-08 11:01:43.803] boot - 6488 INFO [main] --- CentralGetTicketApplication: Starting CentralGetTicketApplication on rMyName with PID 6488 (C:\workspaces\microservicios-quini6-v3\micro-central-get-ticket-test\target\classes started by rMyName in C:\workspaces\microservicios-quini6-v3\micro-central-get-ticket-test) [2015-10-08 11:01:43.847] boot - 6488 INFO [main] --- AnnotationConfigApplicationContext: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6: startup date [Thu Oct 08 11:01:43 GMT-03:00 2015]; root of context hierarchy [2015-10-08 11:01:43.980] boot - 6488 INFO [main] --- AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring [2015-10-08 11:01:44.192] boot - 6488 INFO [main] --- CentralGetTicketApplication: Started CentralGetTicketApplication in 3.049 seconds (JVM running for 3.869) [2015-10-08 11:03:07.221] boot - 6488 INFO [main] --- PropertySourceBootstrapConfiguration: Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='classpath:/config/micro-central-get-ticket.yml']]] [2015-10-08 11:03:07.244] boot - 6488 INFO [main] --- AnnotationConfigEmbeddedWebApplicationContext: Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64f555e7: startup date [Thu Oct 08 11:03:07 GMT-03:00 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6 [2015-10-08 11:03:07.983] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]] [2015-10-08 11:03:08.103] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'infoEndpoint': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration; factoryMethodName=infoEndpoint; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/EndpointAutoConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$InfoEndpointRebinderConfiguration; factoryMethodName=infoEndpoint; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/cloud/autoconfigure/RefreshAutoConfiguration$InfoEndpointRebinderConfiguration.class]] [2015-10-08 11:03:08.125] boot - 6488 INFO [main] --- DefaultListableBeanFactory: Overriding bean definition for bean 'default.null.RibbonClientSpecification': replacing [Generic bean: class [org.springframework.cloud.netflix.ribbon.RibbonClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.cloud.netflix.ribbon.RibbonClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] [2015-10-08 11:03:08.263] boot - 6488 INFO [main] --- GenericScope: BeanFactory id=2ee54948-4ea0-303c-9a4e-7ecb6a22bf0b [2015-10-08 11:03:08.269] boot - 6488 INFO [main] --- AutowiredAnnotationBeanPostProcessor: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring [2015-10-08 11:03:08.288] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.scheduling.annotation.SchedulingConfiguration' of type [class org.springframework.scheduling.annotation.SchedulingConfiguration$$EnhancerBySpringCGLIB$b077a16] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.410] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ab1f6fb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.426] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'transactionAttributeSource' of type [class org.springframework.transaction.annotation.AnnotationTransactionAttributeSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.435] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'transactionInterceptor' of type [class org.springframework.transaction.interceptor.TransactionInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.442] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.transaction.config.internalTransactionAdvisor' of type [class org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.472] boot - 6488 INFO [main] --- PostProcessorRegistrationDelegate$BeanPostProcessorChecker: Bean 'org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$ConfigurationPropertiesRebinderConfiguration' of type [class org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$ConfigurationPropertiesRebinderConfiguration$$EnhancerBySpringCGLIB$$fbb4e411] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [2015-10-08 11:03:08.725] boot - 6488 INFO [main] --- TomcatEmbeddedServletContainer: Tomcat initialized with port(s): 8893 (http) [2015-10-08 11:03:08.839] boot - 6488 INFO [main] --- StandardService: Starting service Tomcat [2015-10-08 11:03:08.840] boot - 6488 INFO [main] --- StandardEngine: Starting Servlet Engine: Apache Tomcat/8.0.20 [2015-10-08 11:03:08.962] boot - 6488 INFO [localhost-startStop-1] --- [/]: Initializing Spring embedded WebApplicationContext [2015-10-08 11:03:08.963] boot - 6488 INFO [localhost-startStop-1] --- ContextLoader: Root WebApplicationContext: initialization completed in 1719 ms [2015-10-08 11:03:09.528] boot - 6488 INFO [localhost-startStop-1] --- ServletRegistrationBean: Mapping servlet: 'dispatcherServlet' to [/] [2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'metricFilter' to: [/] [2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'characterEncodingFilter' to: [/] [2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'webRequestLoggingFilter' to: [/] [2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'hiddenHttpMethodFilter' to: [/] [2015-10-08 11:03:09.534] boot - 6488 INFO [localhost-startStop-1] --- FilterRegistrationBean: Mapping filter: 'applicationContextIdFilter' to: [/*] [2015-10-08 11:03:09.957] boot - 6488 WARN [main] --- URLConfigurationSource: No URLs will be polled as dynamic configuration sources. [2015-10-08 11:03:09.957] boot - 6488 INFO [main] --- URLConfigurationSource: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. [2015-10-08 11:03:09.965] boot - 6488 INFO [main] --- DynamicPropertyFactory: DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@734ce281 [2015-10-08 11:03:10.269] boot - 6488 INFO [main] --- RequestMappingHandlerAdapter: Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64f555e7: startup date [Thu Oct 08 11:03:07 GMT-03:00 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@710b18a6 [2015-10-08 11:03:10.328] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/],methods=[POST],params=[],headers=[],consumes=[application/json],produces=[application/json],custom=[]}" onto public ar.com.boldt.common.business.model.response.central.TicketInfoResponse ar.com.boldt.getticket.controller.GetTicketController.obtenerTicket(ar.com.boldt.common.business.model.request.central.TicketInfoRequest) [2015-10-08 11:03:10.330] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) [2015-10-08 11:03:10.330] boot - 6488 INFO [main] --- RequestMappingHandlerMapping: Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest) [2015-10-08 11:03:10.365] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] [2015-10-08 11:03:10.365] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] [2015-10-08 11:03:10.421] boot - 6488 INFO [main] --- SimpleUrlHandlerMapping: Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] [2015-10-08 11:03:11.014] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/shutdown],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.ShutdownMvcEndpoint.invoke() [2015-10-08 11:03:11.015] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/restart],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.context.restart.RestartMvcEndpoint.invoke() [2015-10-08 11:03:11.015] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.value(java.util.Map) [2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env/reset],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map org.springframework.cloud.context.environment.EnvironmentManagerMvcEndpoint.reset() [2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/info],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env/{name:.}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String) [2015-10-08 11:03:11.016] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/env],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/health],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(java.security.Principal) [2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/mappings],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.017] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/pause],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/metrics/{name:.}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String) [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/metrics],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/refresh],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/resume],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.cloud.endpoint.GenericPostableMvcEndpoint.invoke() [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/configprops],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.018] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/archaius],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/autoconfig],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/beans],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/dump],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.019] boot - 6488 INFO [main] --- EndpointHandlerMapping: Mapped "{[/trace],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke() [2015-10-08 11:03:11.157] boot - 6488 WARN [main] --- URLConfigurationSource: No URLs will be polled as dynamic configuration sources. [2015-10-08 11:03:11.157] boot - 6488 INFO [main] --- URLConfigurationSource: To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. [2015-10-08 11:03:11.174] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Registering beans for JMX exposure on startup [2015-10-08 11:03:11.206] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'refreshEndpoint' has been autodetected for JMX exposure [2015-10-08 11:03:11.206] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'restartEndpoint' has been autodetected for JMX exposure [2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure [2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'refreshScope' has been autodetected for JMX exposure [2015-10-08 11:03:11.207] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Bean with name 'environmentManager' has been autodetected for JMX exposure [2015-10-08 11:03:11.210] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager] [2015-10-08 11:03:11.224] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'restartEndpoint': registering with JMX server as MBean [org.springframework.cloud.context.restart:name=restartEndpoint,type=RestartEndpoint] [2015-10-08 11:03:11.236] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope] [2015-10-08 11:03:11.244] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,type=ConfigurationPropertiesRebinder] [2015-10-08 11:03:11.252] boot - 6488 INFO [main] --- AnnotationMBeanExporter: Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.bootstrap.config:name=refreshEndpoint,type=RefreshEndpoint] [2015-10-08 11:03:11.255] boot - 6488 INFO [main] --- DefaultLifecycleProcessor: Starting beans in phase 0 [2015-10-08 11:03:11.258] boot - 6488 INFO [main] --- EurekaConfigBasedInstanceInfoProvider: Setting initial instance status as: STARTING [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Disable delta property : false [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Single vip registry refresh property : null [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Force full registry fetch : false [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Application is null : false [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Registered Applications size is zero : true [2015-10-08 11:03:11.657] boot - 6488 INFO [main] --- DiscoveryClient: Application version is -1: true [2015-10-08 11:03:12.721] boot - 6488 ERROR [main] --- DiscoveryClient: Can't get a response from http://xxx.xx.xxx.57:8761/eureka/apps/
它永远不会工作,spring 引导文档允许您使用 logging.config 仅将配置文件作为参数传递给 jar,例如,如果您可以使用它编写 url 到您的配置中,spring 以覆盖值启动,并将使用控制台日志记录方式。