Проблема
у нас есть приложение на основе JAVA с пружинной загрузкой, мы пытаемся интегрировать LOKI с приложением, чтобы иметь журналы на панели управления Grafana, получая исключение ниже
исключение:
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]]
текущая настройка/среда
JAVA: 17
Версия Springboot: 2.7.14
Изображение: grafana/loki:latest
Фрагмент кода JAVA
@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
http://a6629f018a6da4430852fbfc7db64d91 ... pi/v1/push
app=${name},host=${HOSTNAME},level=%level
true
{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%message",
"requestId": 100
}
Фрагмент POM.xml следующим образом
org.slf4j
slf4j-api
org.apache.logging.log4j
log4j-slf4j2-impl
2.24.3
com.github.loki4j
loki-logback-appender
1.5.2
мы обратились к этому документу, чтобы задокументировать порядок XML-файла журнала, но проблема все еще существует
https://logback.qos.ch/codes.html# Appender_order
пожалуйста, предложите.
обновление 1
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"]
ОБНОВЛЕНИЕ 2
http://a6629f018a6da4430852fbfc7db64d91 ... pi/v1/push
app=${name},host=${HOSTNAME},level=%level
true
{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%message",
"requestId": 100
}
исключение
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
19:05:03,397 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:34 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Logger][AppenderRef]]
Logging system failed to initialize using configuration from '/mnt/c/Automation/oe-platform/cloudcontroller/src/main/resources/logback-spring.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:34 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Logger][AppenderRef]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:332)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
Подробнее здесь: https://stackoverflow.com/questions/793 ... or-loggers
Ошибка входа в систему: нет применимых действий для [Loggers] ⇐ JAVA
Программисты JAVA общаются здесь
-
Anonymous
1736257143
Anonymous
[b]Проблема[/b]
у нас есть приложение на основе JAVA с пружинной загрузкой, мы пытаемся интегрировать LOKI с приложением, чтобы иметь журналы на панели управления Grafana, получая исключение ниже
[b]исключение:[/b]
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]]
[b]текущая настройка/среда[/b]
JAVA: 17
Версия Springboot: 2.7.14
Изображение: grafana/loki:latest
[b]Фрагмент кода JAVA[/b]
@RestController
//@Tag(name = "Cloud Controller API")
public class CloudController {
private static final Logger LOG = LoggerFactory.getLogger(CloudController.class);
LOG.info("cloud controller invoked");
}
[b]logback-spring.xml[/b]
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
}
[b]Фрагмент POM.xml следующим образом[/b]
org.slf4j
slf4j-api
org.apache.logging.log4j
log4j-slf4j2-impl
2.24.3
com.github.loki4j
loki-logback-appender
1.5.2
мы обратились к этому документу, чтобы задокументировать порядок XML-файла журнала, но проблема все еще существует
https://logback.qos.ch/codes.html# Appender_order
пожалуйста, предложите.
[b]обновление 1[/b]
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"]
[b]ОБНОВЛЕНИЕ 2[/b]
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
}
[b]исключение[/b]
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
19:05:03,397 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:34 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Logger][AppenderRef]]
Logging system failed to initialize using configuration from '/mnt/c/Automation/oe-platform/cloudcontroller/src/main/resources/logback-spring.xml'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@36:34 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Logger][AppenderRef]]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:332)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:298)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246)
Подробнее здесь: [url]https://stackoverflow.com/questions/79335939/logback-error-no-applicable-action-for-loggers[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия