依赖:

<dependency>
<groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-logback-appender</artifactId>
<version>0.1.9</version>
<exclusions>
<exclusion>
<artifactId>log4j-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>

配置:

<appender name="loghubAppender" class="com.aliyun.openservices.log.logback.LoghubAppender">

     <!-- 其他配置省略**** -->

        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
<pattern>%d{HH:mm:ss.SSS} [%tid] kk-lifeno [%thread] %-5level %logger{35} - %msg %n</pattern>
</layout>
</encoder>
</appender>

  

错误信息如下:

Exception in thread "main" java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@55:76 - no applicable action for [encoder], current ElementPath is [[configuration][appender][encoder]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@56:108 - no applicable action for [layout], current ElementPath is [[configuration][appender][encoder][layout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@57:26 - no applicable action for [pattern], current ElementPath is [[configuration][appender][encoder][layout][pattern]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:208)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:74)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:175)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)

  

原因:

0.1.9 版本的aliyun-log-logback-appender jar 中 com.aliyun.openservices.log.logback.LoghubAppender的问题。升级版本 为 0.1.12 或以上即可 

最新文章

  1. mysql-5.6.34 Installation from Source code
  2. [LeetCode] Distinct Subsequences 不同的子序列
  3. Web API应用架构设计分析(1)
  4. 复杂的sql 一对多查询
  5. NodeManager起不来
  6. .net 码农转战 iOS - 初探
  7. selenium webdriver python 等待
  8. Oracle DBA 常用查询
  9. JAVA面向对象-----抽象类
  10. linux 命令之文件读取,head, tail, tailf, sed
  11. python 使用多进程打开多个cmd窗口,并在子进程结束之后关闭cmd窗口
  12. apigateway-kong(五)集群搭建部署
  13. 为什么 c = tf.matmul(a, b) 不立即执行矩阵乘法?
  14. C# -- 等待异步操作执行完成的方式 C# -- 使用委托 delegate 执行异步操作 JavaScript -- 原型:prototype的使用 DBHelper类连接数据库 MVC View中获取action、controller、area名称、参数
  15. 采用Serverless架构搭建Web应用
  16. EF6 使用SQLite Code First
  17. C# wx获取token基本方法
  18. python3 sorted()函数笔记
  19. S5:桥接模式 Bridge
  20. 自动化运维之shell引号和正则表达式(二)

热门文章

  1. Mysql5.7数据导出提示--secure-file-priv选项问题的解决方法
  2. textarea高度自适应(转载)
  3. 微信支付errcode:40163,code been used,错误小结
  4. Beta 冲刺(7/7)
  5. pwnable.tw hacknote
  6. ueditor内容带格式回显(html字符串回显)
  7. md5加密 bas64加密
  8. ConditionalOnBean 与 ConditionalOnMissingBean 的正确玩法
  9. MySQL/Oracle数据库优化总结
  10. Zabbix(二)