logging-log4j2
logging-log4j2 copied to clipboard
Issue 1501: increase default StatusLogger level to warn
Fix of #1501.
- StatusLogger default level bumped from
ERRORtoWARN(used when no config active); - StatusConfiguration default level bumped from
ERRORtoWARN(used as default value). It's method withStatus(String status) modified to default toWARN(used whenstatusstring value found in config file is invalid); - AbstractConfiguration, method
getDefaultStatus()modified to default toWARN, as it is called in a.o. JsonConfiguration and does not change if there is nostatuskey in config file.
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.
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,
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?
@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.