Page 1 of 1

Logback-Fehler: Keine anwendbare Aktion für [Logger]

Posted: 07 Jan 2025, 13:50
by Guest
Problem
Wir haben eine Spring-Boot-JAVA-basierte Anwendung. Wir versuchen, LOKI in die Anwendung zu integrieren, um die Protokolle im Grafana-Dashboard zu haben, und geraten dabei unter die Ausnahme
Ausnahme:

Code: Select all

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
00:42:07,606 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@33:15 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
00:42:07,606 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@35:80 - no applicable action for [Logger], current ElementPath  is [[Configuration][Loggers][Logger]]
00:42:07,606 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:34 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Logger][AppenderRef]]
00:42:07,607 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@39:28 - no applicable action for [root], current ElementPath  is [[Configuration][Loggers][root]]
00:42:07,607 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@40:36 - no applicable action for [appender-ref], current ElementPath  is [[Configuration][Loggers][root][appender-ref]]
aktuelles Setup/Umgebung
JAVA: 17
Springboot-Version: 2.7.14
Bild: grafana/loki:latest
JAVA-Code-Snippet

Code: Select all

@RestController
//@Tag(name = "Cloud Controller API")
public class CloudController {

private static final Logger LOG = LoggerFactory.getLogger(CloudController.class);

LOG.info("cloud controller invoked");

}
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
}



















POM.xml-Snippet wie folgt

Code: Select all

org.slf4j
slf4j-api




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



com.github.loki4j
loki-logback-appender
1.5.2


wir haben dieses Dokument verwiesen, um die Logback-XML-Reihenfolge zu dokumentieren, immer noch das Problem
https://logback.qos.ch/codes.html# appender_order
bitte vorschlagen.
Update 1

Code: Select all

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

.   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/  ___)| |_)| | | | | || (_| |  ) ) ) )
'  |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::               (v2.7.14)

18:17:38,997 |-WARN in Logger[oe.kubeapi.cloudcontroller.swagger.swaggerui.SwaggerUiApplication] - No appenders present in context [default] for logger [oe.kubeapi.cloudcontroller.swagger.swaggerui.SwaggerUiApplication].
Jan 07, 2025 6:17:41 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Jan 07, 2025 6:17:41 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Tomcat]
Jan 07, 2025 6:17:41 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet engine: [Apache Tomcat/9.0.78]
Jan 07, 2025 6:17:41 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring embedded WebApplicationContext
Jan 07, 2025 6:17:44 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]