0

Getting this compilation Error for logger.isErrorEnabled(),logger.isWarnEnabled() with jar The method isErrorEnabled() is undefined for the type Logger

The method isWarnEnabled() is undefined for the type Logger

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.1.RELEASE</version>
    </parent>
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.14</version>
</dependency>
<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.SR2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <properties>
        <java.version>1.9</java.version>
        <github.global.server>github</github.global.server>
    </properties>
Thiru
  • 699
  • 2
  • 7
  • 19
  • As for **spring-cloud**, **spring-boot** supplies a **BOM** (org.springframework.boot:spring-boot-dependencies:2.1.1.RELEASE) to be used with the scope `import` which will handle (among other relative dependencies) a **log4j** version that work well with this version of spring. – Loïc Le Doyen Dec 19 '18 at 18:45
  • Please consider following this [guide](https://www.callicoder.com/spring-boot-log4j-2-example/) – Yurii Bondarenko Dec 19 '18 at 18:52
  • 1
    Spring Boot 2.x doesn't support Log4j 1... Also don't directly use Log4j use an api like the default SLF4j api. – M. Deinum Dec 19 '18 at 19:18
  • I must politely disagree with @M.Deinum regarding not using log4j2 directly for the reasons stated in [this answer](https://stackoverflow.com/a/41500347/3284624) – D.B. Jan 20 '19 at 00:06

0 Answers0