我正在使用Spring引导应用程序。当我尝试将https://github.com/SumoLogic/sumologic-logback-appender添加到我的项目并在logback.xml中添加配置时,如下所示
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="SumoAppender" class="com.sumologic.logback.SumoLogicAppender">
<encoder>
<Pattern>
%date{ISO8601,UTC} [%t] %-5p %c - %m%n
</Pattern>
</encoder>
<url>[collector-url]</url>
</appender>
<Logger name="SumoLogger" level="info">
<appender-ref ref="SumoAppender" />
</Logger>
</configuration>我得到了下面的错误,无法继续
ERROR in ch.qos.logback.core.joran.action.AppenderAction - Could not create an Appender of type [com.sumologic.logback.SumoLogicAppender]. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type com.sumologic.logback.SumoLogicAppender
ERROR in ch.qos.logback.core.joran.spi.Interpreter@52:79 - ActionException in Action for tag [appender] ch.qos.logback.core.joran.spi.ActionException: ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type com.sumologic.logback.SumoLogicAppender
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [SumoAppender]. Did you define it below instead of above in the configuration file?
ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.Maven依赖项链接- https://mvnrepository.com/artifact/com.sumologic.plugins.log4j/sumologic-log4j2-appender/1.13
任何帮助都是有用的
发布于 2022-10-18 07:52:13
我找到了我的问题的答案。这是我的错。我正在使用log4j jar并查找logback类文件。我通过使用logback jar进行修正,如下所示
// https://mvnrepository.com/artifact/com.sumologic.plugins.logback/sumologic-logback-appender
implementation group: 'com.sumologic.plugins.logback', name: 'sumologic-logback-appender', version: '1.8'发布于 2022-10-18 07:25:12
我的预感是,您在运行时从类路径中丢失了sumologic-logback-appender jar。
https://stackoverflow.com/questions/74106677
复制相似问题