CLASS_NOT_FOUND-Problem mit Loki4jAppenderJava

Java-Forum
Guest
 CLASS_NOT_FOUND-Problem mit Loki4jAppender

Post by Guest »

Wir verwenden Loki4jAppender, um die Streams in der Spring-Boot-Java-Anwendung zu protokollieren.
Nachdem alle Abhängigkeitsprobleme in Maven POM.xml behoben wurden, wird der folgende Fehler angezeigt
< blockquote>
root@CSX-:/mnt/c/Automation/oe-platform/cloudcontroller/target#
java -jar
-Dlogging.config=/mnt/c/Automation/oe-platform/cloudcontroller/src/main/resources/logback-spring.xml
swagger-ui-0.0.1-SNAPSHOT.jar 2025-01- 05 21:39:56,047 main ERROR Fehler
Verarbeitungselement-Appender ([Konfiguration: null]): CLASS_NOT_FOUND
. ____ _ __ _ _ /\ / ' __ _ () __ __
_ \ \ \ \ ( ( )__ |. '| |)| | | | | || (| | ) ) ) ) ' || .__|| ||| |_, | / / / /
=========||==============|
/=//// :: Spring Boot :: (v2.7.14)
SLF4J: Die Klasse „org.slf4j.impl.StaticLoggerBinder“ konnte nicht geladen werden.
SLF4J: Standardmäßig wird die No-Operation (NOP)-Logger-Implementierung SLF4J verwendet:
Weitere
Details finden Sie unter http://www.slf4j.org/codes.html#StaticLoggerBinder. 5. Jan. 2025 21:40:00 Uhr org.apache.coyote.AbstractProtocol
init INFO: Initialisierung von ProtocolHandler ["http-nio-8080"] 5. Jan. 2025
21:40:00 Uhr org .apache.catalina.core.StandardService startInternal
INFO: Dienst wird gestartet [Tomcat] Jan 05.05.2025 21:40:00 Uhr
org.apache.catalina.core.StandardEngine startInterne INFO: Startet
Servlet-Engine: [Apache Tomcat/9.0.78] 05.01.2025 09:40:00 PM
org.apache.catalina.core.ApplicationContext log INFO: Initialisierung
Spring eingebettet WebApplicationContext 5. Januar 2025 21:40:03 Uhr
org.apache.coyote.AbstractProtocol start INFO: Starting
ProtocolHandler ["http-nio-8080"]

Für den Logger verwenden wir slf4j
pom.xml-Snippet ist wie folgt unten

Code: Select all



org.slf4j
slf4j-api



org.apache.logging.log4j
log4j-slf4j2-impl
2.24.3






com.github.loki4j
loki-logback-appender



die Logback-Spring-XML

Code: Select all






http://a6629f018a6da4430852fbfc7db64d91-1818106300.us-east-1.elb.amazonaws.com:32730/loki/api/v1/push



app=${name},host=${HOSTNAME},level=%level
true



{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%message",
"requestId": 100
}








Warum wird die Klasse nicht gefunden?
Irgendwelche Konfigurationsprobleme?
UPDATE 1

00:11:30,692 |-ERROR in
ch.qos.logback.core.joran.spi.Interpreter@29:15 – keine anwendbare Aktion
für [Logger], aktueller ElementPath ist [[Konfiguration][Logger]]
00:11:30,692 |-ERROR in
ch.qos.logback.core.joran.spi.Interpreter@31:80 - Keine anwendbare Aktion
für [Logger], aktueller ElementPath ist
[[Konfiguration][Logger][Logger]] 00:11:30,692 |-ERROR in
ch.qos.logback.core.joran.spi.Interpreter@32:34 – keine anwendbare Aktion
für [AppenderRef], aktueller ElementPath ist
[[Konfiguration][Logger][Logger][AppenderRef]] 00:11:30,692 |-ERROR
in ch.qos.logback.core.joran.spi.Interpreter@35:28 – keine anwendbare
Aktion für [root], aktueller ElementPath ist
[[Configuration][Loggers][root]] 00: 11:30,692 |-ERROR in
ch.qos.logback.core.joran.spi.Interpreter@36:36 – keine anwendbare Aktion
für [appender-ref] ist der aktuelle ElementPath
[[Configuration][Loggers][root][appender-ref]] Das Protokollierungssystem konnte
nicht mit der Konfiguration von
initialisiert werden.'/ mnt/c/Automation/oe-platform/cloudcontroller/src/main/resources/logback-spring.xml'
java.lang.IllegalStateException: Logback-Konfigurationsfehler erkannt:

unten ist die neueste Logback-XML

Code: Select all






http://a6629f018a6da4430852fbfc7db64d91-1818106300.us-east-1.elb.amazonaws.com:32730/loki/api/v1/push



app=${name},host=${HOSTNAME},level=%level
true



{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%message",
"requestId": 100
}



















Ich verstehe jetzt nicht, welche Aktion fehlt und wo ich sie bekommen kann. Bitte vorschlagen

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post