我已經升級springboot版本1.3.3,但我面臨着一些問題的logback:springboot升級從1.2.1到1.3.3的logback從1.2.1問題
與1.2.1版它工作完全正常:
異常:
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in [email protected]:16 - no applicable action for [pattern], current ElementPath is [[configuration][appender][layout][pattern]]
ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION
ERROR in [email protected]:66 - no applicable action for [staticField], current ElementPath is [[configuration][appender][layout][staticField]]
ERROR in [email protected]:24 - no applicable action for [key], current ElementPath is [[configuration][appender][layout][staticField][key]]
ERROR in [email protected]:26 - no applicable action for [value], current ElementPath is [[configuration][appender][layout][staticField][value]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:151)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:195)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:65)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:50)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:277)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:255)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:224)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:200)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.gatcbiotech.blueberry.crud.lims.Application.main(Application.java:14)
Logback.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>BlueBerry %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="AMQP" class="org.springframework.amqp.rabbit.logback.AmqpAppender">
<!-- <filter class="com.gatcbiotech.blueberry.util.LogsFilter" />-->
<layout class="me.moocar.logbackgelf.GelfLayout">
<pattern>BlueBerry %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<shortMessageLayout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</shortMessageLayout>
<useLoggerName>true</useLoggerName>
<useThreadName>true</useThreadName>
<useMarker>true</useMarker>
<includeFullMDC>true</includeFullMDC>
<fieldType>requestId:long</fieldType>
<staticField class="me.moocar.logbackgelf.Field">
<key>_facility</key>
<value>GELF</value>
</staticField>
</layout>
<host>srv173.intern.heckpeck.com</host>
<port>5672</port>
<username>guest</username>
<password>guest</password>
<exchangeType>direct</exchangeType>
<exchangeName>amq.direct</exchangeName>
<applicationId>RabbitMq-IT-SE</applicationId>
<routingKeyPattern>logs</routingKeyPattern>
<generateId>true</generateId>
<charset>UTF-8</charset>
<durable>true</durable>
<abbreviation>36</abbreviation>
<deliveryMode>NON_PERSISTENT</deliveryMode>
<declareExchange>true</declareExchange>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<!-- <appender-ref ref="GELF TCP APPENDER"/>-->
<appender-ref ref="AMQP"/>
</root>
</configuration>
我嘗試使用依賴管理在這個問題中提及,但它並沒有爲我工作:
spring-boot upgrade from 1.3.2 to 1.3.3: logback issue
請問您可以發佈「mvn dependency:tree」的結果嗎? – alexbt