Java – logback is used, but log4j starts displaying warn no Appenders

I'm using logback for logging, but it's working all the time; One day I began to warn

Log4j: warn did not find the appender of the recorder (org. Apache. Axis. I18N. Projectresourcebundle) Log4j: warn please initialize the log4j system correctly

I did not use log4j, nor did I use this project There is a logback in my resources folder xml.

Any thoughts on why this warning began to appear?

Solution

You must use log4j's library Can you post more about your project?

You should put the log4j bridge on the classpath Read more here: http://www.slf4j.org/legacy.html

The jar you want to view is log4j-over-slf4j It will bridge the log4j API to actually call the implementation of your slf4j API (logback in your case)

If you use Maven to build a project, it may be as simple as placing

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>log4j-over-slf4j</artifactId>
    <version>1.7.7</version>
</dependency>

Dependence

The exclusion Library (if necessary) will be completed in this way (assuming that we are talking about the delivery dependency from the jar you mentioned):

<dependency>
        <groupId>org.swift.common</groupId>
        <artifactId>jira-soap</artifactId>
        <version>4.4.0</version>
        <exclusions>
            <exclusion>
                <groupId>...</groupId>
                <artifactId>...</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>