[
https://issues.apache.org/jira/browse/LOG4J2-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17477832#comment-17477832
]
Gary D. Gregory edited comment on LOG4J2-3340 at 1/18/22, 1:47 PM:
-------------------------------------------------------------------
Note:
In StatusLogger, we have:
this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true,
showDateTime, false, dateFormat, messageFactory, PROPS, System.err);
final Level defaultLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN);
Which does not match, so it is confusing. There are two settings with 2
different defaults:
The default logger level is ERROR (as documented on our site).
The default listener level is WARN (as documented on our site)
I'll clarify the code and Javadoc, and make sure the tests pass.
Ok to make both WARN? Or both ERROR? I'm inclined to default both to ERROR. I'm
also thinking of having have the new setting (log4j2.StatusLogger.level)
override the legacy setting (log4j2.debug)
If we make both ERROR, the tests need no change. Either change needs a doc
update.
What does it even mean to have the StatusLogger with settings for the logger
level and listener level to be different?
was (Author: garydgregory):
Note:
In StatusLogger, we have:
this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true,
showDateTime, false, dateFormat, messageFactory, PROPS, System.err);
final Level defaultLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN);
Which does not match, so it is confusing. There are two settings with 2
different defaults:
The default logger level is ERROR (as documented on our site).
The default listener level is WARN (as documented on our site)
I'll clarify the code and Javadoc, and make sure the tests pass.
Ok to make both WARN? Or both ERROR? I'm inclined to default both to ERROR. I'm
also thinking of having have the new setting (log4j2.StatusLogger.level)
override the legacy setting (log4j2.debug)
If we make both ERROR, the tests need no change. Either change needs a doc
update.
What does it even mean to have a Status logger with settings for the logger
level and listener level to be different?
> StatusLogger's log Level cannot be changed as advertised
> --------------------------------------------------------
>
> Key: LOG4J2-3340
> URL: https://issues.apache.org/jira/browse/LOG4J2-3340
> Project: Log4j 2
> Issue Type: Bug
> Reporter: Michael Vorburger
> Assignee: Gary D. Gregory
> Priority: Major
> Fix For: 2.17.2
>
>
> I would like to see the warn log from {{LogManager}} re. which implementation
> it picked, if multiple.
> I would like to be able to do this without a system property but using a
> properties file on the classpath.
> StatusLogger's JavaDoc (currently) says that "This can be overridden via a
> system property named #DEFAULT_STATUS_LISTENER_LEVEL and will work with any
> Log4j provider.", where DEFAULT_STATUS_LISTENER_LEVEL is
> "log4j2.StatusLogger.level".
> However that currently doesn't seem to quite work as advertised. (If you
> think it does, please suggest how.) I can see some stuff in StatusLogger
> related to its default log level been (only?) for StatusListener and
> StatusData? This seems confusing.
> I'll raise a PR with a proposed simple fix for this for your review.
> [~ckozak] / [~ggregory]
--
This message was sent by Atlassian Jira
(v8.20.1#820001)