Are wildcards allowed in Log4j (via Spring Boot Logging) on ​​the logging.level property?

While I was installing a Java application that uses Log4j (via Spring Boot Logging), I was told that I can configure the logging level for all packages used in the application by including the following line in the file application.properties

logging.level.*=ERROR

Where ERRORcan there be any logging level that I wanted to use.

However, when I changed the level from one value to another, no matter what value I used, I found that the log messages before appear in the log DEBUG.

In the end, I found that using specific package names, I could control the minimum level for registration. That is, it logging.level.org.orgname.appname=ERRORwill do what I wanted.

Are log level properties designed to support wildcards of type "*"?

+4
source share
1 answer

Since my question seems unpopular, but I still found the answer, I will post it for completeness.

Neither Log4j nor Spring Boot Logging supports wildcards such as logging.level.*. There is some documentation that uses this exact phrase, but they mean that the reader can replace the package name for the asterisk. My colleagues did not understand this and used it verbatim in the documentation for their application.

Spring Boot Logging logging.level.root. Log4j log4j.rootLogger, , .

+3

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


All Articles