添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath is [[Configuration][Appenders]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath is [[Configuration][Appenders][Console]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:92 - no applicable action for [PatternLayout], current ElementPath is [[Configuration][Appenders][Console][PatternLayout]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:49 - no applicable action for [RollingFile], current ElementPath is [[Configuration][Appenders][RollingFile]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:28 - no applicable action for [PatternLayout], current ElementPath is [[Configuration][Appenders][RollingFile][PatternLayout]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@11:26 - no applicable action for [pattern], current ElementPath is [[Configuration][Appenders][RollingFile][PatternLayout][pattern]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@13:23 - no applicable action for [Policies], current ElementPath is [[Configuration][Appenders][RollingFile][Policies]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:59 - no applicable action for [SizeBasedTriggeringPolicy], current ElementPath is [[Configuration][Appenders][RollingFile][Policies][SizeBasedTriggeringPolicy]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@16:50 - no applicable action for [DefaultRolloverStrategy], current ElementPath is [[Configuration][Appenders][RollingFile][DefaultRolloverStrategy]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@20:14 - no applicable action for [Loggers], current ElementPath is [[Configuration][Loggers]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@21:29 - no applicable action for [Root], current ElementPath is [[Configuration][Loggers][Root]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@22:46 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Root][AppenderRef]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@23:42 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Root][AppenderRef]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@25:76 - no applicable action for [Logger], current ElementPath is [[Configuration][Loggers][Logger]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@26:44 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Logger][AppenderRef]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@27:40 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Logger][AppenderRef]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@29:68 - no applicable action for [Logger], current ElementPath is [[Configuration][Loggers][Logger]] ERROR in ch.qos.logback.core.joran.spi.Interpreter@30:44 - no applicable action for [AppenderRef], current ElementPath is [[Configuration][Loggers][Logger][AppenderRef]] at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162) at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66) at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:56) at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115) at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:308) at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239) at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework. enter code here context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)

My logback configuration is:

<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        </Console>
        <RollingFile name="RollingFile" fileName="${sys:home}/logs/log"
            filePattern="${sys:home}/logs/mylog-%i.log" bufferedIO="false"
            immediateFlush="true" append="true">
            <PatternLayout>
                <pattern>%d %p [%t] %c{1.} %m%n</pattern>
            </PatternLayout>
            <Policies>
                <SizeBasedTriggeringPolicy size="20 MB" />
            </Policies>
            <DefaultRolloverStrategy max="100" />
        </RollingFile>
    </Appenders>
    <Loggers>
        <Root level="error">
            <AppenderRef ref="RollingFile" />
            <AppenderRef ref="Console" />
        </Root>
        <Logger name="org.springframework" level="info" additivity="false">
            <AppenderRef ref="RollingFile"></AppenderRef>
            <AppenderRef ref="Console"></AppenderRef>
        </Logger>
        <Logger name="com.myproj" level="debug" additivity="false">
            <AppenderRef ref="RollingFile"></AppenderRef>
        </Logger>
    </Loggers>
</Configuration>
                I'm not 100% sure but it looks like you have incorrect syntax of logback configuration. Refer to logback.qos.ch/manual/configuration.html
– Nikolai  Shevchenko
                Feb 26, 2018 at 14:46

This is probably log4j2 configuration. And to support it your Spring Boot pom file must be updated as following:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

See more details here: https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-logging (section 8.2 Configure Log4j for Logging).

Had the same problem dealing with logback. For me, adding the implementation dependency for the current version worked without setting an exclusion. – MMascarin Aug 17, 2021 at 19:12 @MMascarin - may you please explain what was done in detail? I am getting this issue since last 3 days and not able to resolve :/ Please help – Lisbon Dec 22, 2021 at 7:28 I think I just tried mp31415's solution (of just separately declaring spring-boot-starter-log4j2) and realised that I actually don't need the exclusion for it to work. – MMascarin Dec 23, 2021 at 12:21

The error can be resolved by using

<appender name="Console"
            class="ch.qos.logback.core.ConsoleAppender">

instead of

<Console name="Console" target="SYSTEM_OUT">

Link for reference

Below is the reference how you can do it :-

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan = "true">
        <property name="LOGS" value="./logs" />
        <property resource ="application.yml"/>
        <springProperty name="NAME" source="spring.application.name" />
        <appender name="Console"
            class="ch.qos.logback.core.ConsoleAppender">
            <layout class="ch.qos.logback.classic.PatternLayout">
                <Pattern>
                    %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
                </Pattern>
            </layout>
        </appender>
        <appender name="RollingFile"
        class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${LOGS}/${NAME}.log</file>
        <encoder
            class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
        </encoder>
        <rollingPolicy
            class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- rollover daily and when the file reaches 10 MegaBytes -->
            <fileNamePattern>${LOGS}/archived/spring-boot-logger-%d{yyyy-MM-dd}.%i.log
            </fileNamePattern>
            <timeBasedFileNamingAndTriggeringPolicy
                class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                <maxFileSize>10MB</maxFileSize>
            </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
    </appender>
    <root level="info">
        <appender-ref ref="RollingFile" />
        <appender-ref ref="Console" />
    </root>
    <logger name="com.ms" level="trace" additivity="false">
        <appender-ref ref="RollingFile" />
        <appender-ref ref="Console" />
    </logger>
    <logger name="org.springframework.core.env.PropertySourcesPropertyResolver" level="trace" additivity="true">
    </logger>
</configuration>
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.