java – log4j. Properties does not work properly on wildfly

I have a log4j in my classpath Properties file

It is located on APP / XX jar / log4j. Properties location

I noticed that in the ear file, I can also find log4j - 1.2. In the Lib folder 17.jar.

But whether I'm in log4j What is written in the properties file is ignored Like:

log4j.rootCategory=WARN

Or something like that:

log4j.rootCategory=INFO,A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.logger.org.springframework=WARN

However, all records will still be printed on the server

Do I configure them incorrectly or let my wildly this property file igored?

Solution

Given the location of the properties file, it will be ignored If log4j If the properties file is located in the ear / meta-inf directory, wildfly will try to configure log4j.inf for you It is not recommended to use consoleappender because it may cause deadlock because the appender attempts to write to system Out and system Out is packaged in wildfly

Given the configuration, this will give you three options

>Change the value of add logging API dependencies to false. > Add JBoss deployment structure XML and disable logging subsystem in deployment > configure logging through logging subsystem This can be done globally or through logging profile

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
分享
二维码
< <上一篇
下一篇>>