У меня проблемы с использованием logsta sh -logback-encoder. Я использую кодировщик:
<appender name="FILE-ERROR" class="ch.qos.logback.core.FileAppender">
<file>${LOG_FILE_PATH}${ERROR_FILE_NAME}</file>
<append>true</append>
<immediateFlush>true</immediateFlush>
<!-- Filtro de level -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
**<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">**
...
My pom. xml is:
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
Он отлично работает, когда я запускаю intellij , но когда я развертываю Tomcat, у меня появляется эта ошибка:
10-Jul-2020 18:47:34.906 INFO [localhost-startStop-2] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
10-Jul-2020 18:47:36.910 SEVERE [localhost-startStop-2] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/msid (16)]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1840)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not create component [encoder] of type [net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder] java.lang.ClassNotFoundException: net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder
ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:113 - no applicable action for [jsonGeneratorDecorator], current ElementPath is [[configuration][appender][encoder][jsonGeneratorDecorator]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:24 - no applicable action for [providers], current ElementPath is [[configuration][appender][encoder][providers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@24:28 - no applicable action for [timestamp], current ElementPath is [[configuration][appender][encoder][providers][timestamp]]
...
Кто-нибудь когда-нибудь сталкивался с этим?