Spring Download ignoring logback- spring.xml

I have 2 Spring Boot applications (1.4.1-RELEASE) using Logback. Both configuration files are more or less identical, located in my / src / main / resources folder and are called logback-spring.xml .

Both projects include a maven spring-boot-startter-logging dependency in their pom.xml and log version 1.1.7 retrieval.

Spring boot configuration as defined in both poms:

<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 http://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>1.4.1.RELEASE</version>
    <relativePath />
</parent>

<groupId>d.m.v.app-a</groupId>
<artifactId>my-app-a</artifactId>
<version>1.0.16-SNAPSHOT</version>
<packaging>jar</packaging>  

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-logging</artifactId>
    </dependency>
</dependencies>

However, when starting applications, one of them seems to completely ignore the log configuration, and the other selects it as expected.

logback.xml , , ( Spring, ).

( pom.xml, application.properties ..).

- , ? .

+6
2

, , , , logback.xml (-, , , ).

: org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(LoggingInitializationContext, LogFile)

, .

spring boot ( "logback-test.groovy", "logback-test.xml", "logback.groovy", "logback.xml" ) , spring.xml .

+2

application.properties , .

logging.config=path

Spring . Spring doc

logback- spring.xml, logback.xml

application.properties, .

+1

Source: https://habr.com/ru/post/1017202/


All Articles