logging-log4j2 icon indicating copy to clipboard operation
logging-log4j2 copied to clipboard

Issue 1501: increase default StatusLogger level to warn

Open lukaszspyra opened this issue 2 years ago • 4 comments

Fix of #1501.

  1. StatusLogger default level bumped from ERROR to WARN (used when no config active);
  2. StatusConfiguration default level bumped from ERROR to WARN(used as default value). It's method withStatus(String status) modified to default to WARN (used when status string value found in config file is invalid);
  3. AbstractConfiguration, method getDefaultStatus() modified to default to WARN, as it is called in a.o. JsonConfiguration and does not change if there is no status key in config file.

lukaszspyra avatar Jul 24 '23 07:07 lukaszspyra

I am not in favor of this. We should fix the original problem that a JSON or YAML configuration is found but dependencies are missing to log at error instead.

rgoers avatar Jul 26 '23 23:07 rgoers

I am not in favor of this. We should fix the original problem that a JSON or YAML configuration is found but dependencies are missing to log at error instead.

Looking at the thread on dev, I believe majority did not like the idea of changing default StatusLogger level, so changes reverted and error logged as suggested (JSON/YAML ConfigurationFactory is not active and found corresponding config file).

lukaszspyra avatar Oct 11 '23 15:10 lukaszspyra

@lukaszspyra,

Sorry for the delayed answer.

Your PR looks good to me, if the default status logger level of ERROR can not be changed.

Personally I don't agree that WARN messages should be hidden by default and I prefer your original version, but there is no consensus on this matter in the PMC. @vy what do you think?

ppkarwasz avatar Jan 22 '24 12:01 ppkarwasz

@lukaszspyra, I am sorry for the delay. There were more pressing issues. As a part of our ongoing effort to clean up the log4j-api in 2.x, we are re-visiting the idea of decreasing the default StatusLogger level from ERROR to WARN. PMC is mostly concerned about the noise this will create for existing users.

Once the default level is set to WARN, some warnings will start getting displayed on unrecognized/ignored properties. This is good. OTOH, there will also appear some not much useful warnings, e.g., The bufferSize is set to ... but bufferedIo is false. ~Would you be interested in fixing these (e.g., lowering the level of such messages to INFO or conditionally enabling them) and adding that your PR? I believe we (@ppkarwasz?) can provide assistance for such an effort. PMC needs to be convinced anyway.~ @ppkarwasz will take care of those.

vy avatar Jan 22 '24 14:01 vy