Skip to content

spring-boot application get warning: CONSOLE_LOG_PATTERN_IS_UNDEFINED #12925

@kuchaguangjie

Description

@kuchaguangjie

There is a spring-boot (2.0.0.RELEASE) application as part of the spring-cloud (Finchley.M9) cluster.
On startup, it always print following line:

CONSOLE_LOG_PATTERN_IS_UNDEFINEDCONSOLE_LOG_PATTERN_IS_UNDEFINEDCONSOLE_LOG_PATTERN_IS_UNDEFINED

Screenshot:
a


(following are the configuration)

application.yml:

## spring-boot configuration,

# logging
logging:
  file: "log/hello.log"
  pattern:
    console: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level [%t] [%logger - %line]: %m%n"
    file: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level [%t] [%logger - %line]: %m%n"
  level:
    root: INFO

spring:
  application:
    name: eric-sc-hello

server:
  port: 9191

management:
  endpoints:
    web:
      exposure:
	include: "*"

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

eric-sc-hello:
  ribbon:
    eureka:
      enabled: false
    listOfServers: localhost:9191,localhost:9192,localhost:9193
    ServerListRefreshInterval: 15000

logback-spring.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <charset>UTF-8</charset>
      <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
    </encoder>
  </appender>
  <appender name="FILE"
    class="ch.qos.logback.core.rolling.RollingFileAppender">
    <encoder>
      <pattern>${FILE_LOG_PATTERN}</pattern>
    </encoder>
    <file>${LOG_FILE}</file>
    <rollingPolicy
      class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <fileNamePattern>${LOG_FILE}.%i</fileNamePattern>
      <minIndex>1</minIndex>
      <maxIndex>10</maxIndex>
    </rollingPolicy>
    <triggeringPolicy
      class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
      <MaxFileSize>10MB</MaxFileSize>
    </triggeringPolicy>
  </appender>

  <root level="INFO">
    <appender-ref ref="CONSOLE" />
    <appender-ref ref="FILE" />
  </root>
</configuration>

The warning says CONSOLE_LOG_PATTERN is undefined for 3 times.

But logging.pattern.console is defined in application.yml, and the log lines in console is printed in the specified format.

So, why the warning pop-up, and how can I remove it?

(I asked this on stackoverflow several days ago, but didn't get any respond yet: https://stackoverflow.com/questions/49879518)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions