无法将 'logging.level.com.netflix.eureka' 下的属性绑定到 org.springframework.boot.logging.LogLevel:

Failed to bind properties under 'logging.level.com.netflix.eureka' to org.springframework.boot.logging.LogLevel:

错误

//Console log error
2022-03-23 20:26:57.239 ERROR 18140 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'logging.level.com.netflix.eureka' to org.springframework.boot.logging.LogLevel:

    Property: logging.level.com.netflix.eureka
    Value: ON
    Origin: class path resource [application.properties] - 10:34
    Reason: failed to convert java.lang.String to org.springframework.boot.logging.LogLevel (caused by java.lang.IllegalArgumentException: No enum constant org.springframework.boot.logging.LogLevel.ON)

Action:

Update your application's configuration. The following values are valid:

    DEBUG
    ERROR
    FATAL
    INFO
    OFF
    TRACE
    WARN


Process finished with exit code 1

pom.xml


// maven and the dependencies
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>mang.io</groupId>
    <artifactId>eureka-server-application</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>eureka-server-application</name>
    <description>Microservice that returns a list of dogs with h2 and Eureka server</description>
    <properties>
        <java.version>17</java.version>
        <spring-cloud.version>2021.0.1</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bootstrap</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.4.0-b180725</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

EurekaServerApplication 项目的主要class

package mang.io.eurekaserverapplication;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(EurekaServerApplication.class, args);
    }

}

如何配置和 运行 一个简单的 spring eureka 服务器

您能否分享您的 application.properties 文件的内容。您似乎将 属性 logging.level.com.netflix.eureka 设置为不正确的值。 'ON' 不是有效值。允许的值为 DEBUG、WARN、INFO、TRACE 等