Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.10.0
-
None
-
None
Description
I struggle to understand why name attribute is required in the properties format.
Have a look at this trivial config:
appenders = console appender.console.type = Console appender.console.name = STDOUT appender.console.layout.type = PatternLayout appender.console.layout.pattern = [%-5p] %m%n rootLogger.level = debug rootLogger.appenderRef.console.ref = STDOUT
I know that "appenders = console" string is not necessary which is good but omitting the name attribute for appender results in "No name attribute provided for Appender console" error. The question is why it can't use the component's console name by default? It's supper confusing that I have to introduce a new name, STDOUT in this case, to reference appender from the logger. I'd rather use the same console appender's component name, which is much more natural.
Sorry, if I'm suggesting something that is totally wrong, I'm new to log4j and trying to make sense of it from the documentation which is not well structured to say the least.
Maybe at least Configuration with Properties section in the documentation could be completed by mentioning that the name attribute is required? Right now it only states that the type attribute must be specified.