You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "robozb (via GitHub)" <gi...@apache.org> on 2023/02/23 00:18:08 UTC
[GitHub] [logging-log4j2] robozb opened a new issue, #1285: Identifiers, names, refs
robozb opened a new issue, #1285:
URL: https://github.com/apache/logging-log4j2/issues/1285
Why do you need both identifiers and names? Is one of them not enough to identify the appender at logger definition?
for example: appender.console.name = STDOUT
I know my english is terrible, but this is the most incomprehensible documentation I have ever read:
https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties
It is full of ambiguous statements. Brain surgery is easier to learn than log4j documentation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Identifiers, names, refs, nightmare docs, logging hell level 999 (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz closed issue #1285: Identifiers, names, refs, nightmare docs, logging hell level 999
URL: https://github.com/apache/logging-log4j2/issues/1285
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4j2] rgoers commented on issue #1285: Identifiers, names, refs, nightmare docs, logging hell level 999
Posted by "rgoers (via GitHub)" <gi...@apache.org>.
rgoers commented on issue #1285:
URL: https://github.com/apache/logging-log4j2/issues/1285#issuecomment-1442024114
The Log4j configuration is a tree structure organized as "Nodes" where a Node is nothing but a container of attributes and child Nodes. All the configuration dialects Log4j supports are converted into a Node tree. This works great for Yaml, JSON, and XML. Unfortunately, by their nature properties are not hierarchical. This means using properties is somewhat fitting a round peg in a square hole. For years Log4j didn't support properties due to this but we finally added it due to user's requests. We have made slight "improvements" over time at user's requests but in the end I really don't think it makes it any simpler.
I should note that the way Log4j 1 handled configuration was completely different. Properties were the original and only format. XML was bolted on after the fact and was basically a different configuration system from using properties.
I, for one, highly encourage users to use a different one of the other formats.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4j2] ppkarwasz commented on issue #1285: Identifiers, names, refs, nightmare docs, logging hell level 999
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #1285:
URL: https://github.com/apache/logging-log4j2/issues/1285#issuecomment-1442170110
@robozb,
The identifiers in the properties format are almost useless. One of the last attempts to make the properties format more digestible (#733 and related issues) proposed to use them as default appender names, but the feature never made it out to the main code.
Such a usage would be in line with what Log4j 1.x did, but is not coherent with other formats: most formats use the identifiers/keys/element names to indicate the plugin type. You can see it in Ralph's YAML example:
```lang-yaml
appenders:
Console:
name: STDOUT
PatternLayout:
Pattern: "%m%n"
File:
name: FILE
fileName: ${filename}
bufferedIO: false
PatternLayout:
Pattern: "%d %p %C{1.} [%t] %m%n"
```
The keys `Console`, `File` and `PatternLayout` associated to YAML objects are used as _default_ values for the missing `type` properties.
We could probably implement something similar in the properties format:
```
appender.Console.name = STDOUT
appender.Console.PatternLayout.pattern = "%m%n"
appender.File.name = FILE
appender.File.fileName = ${filename}
appender.File.bufferedIO = false
appender.File.PatternLayout.pattern = %d %p %C{1.} [%t] %m%n
```
However there isn't much to be done if multiple appenders of the same type are required. In the YAML format we currently support the following shorthand:
```lang-yaml
Appenders:
File:
- name: FILE1
fileName: file1.log
- name: FILE2
fileName: file2.log
```
(i.e. for YAML arrays the default type is the key associated to the array). I don't think anything similar would be possible for the properties format.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4j2] robozb commented on issue #1285: Identifiers, names, refs, nightmare docs, logging hell level 999
Posted by "robozb (via GitHub)" <gi...@apache.org>.
robozb commented on issue #1285:
URL: https://github.com/apache/logging-log4j2/issues/1285#issuecomment-1442110306
Dear @rgoers,
Thank you very much for your quick answer! You are really kind!
Best Regards: Bela
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [logging-log4j2] robozb commented on issue #1285: Identifiers, names, refs, nightmare docs, logging hell level 999
Posted by "robozb (via GitHub)" <gi...@apache.org>.
robozb commented on issue #1285:
URL: https://github.com/apache/logging-log4j2/issues/1285#issuecomment-1442179869
Dear @ppkarwasz,
Thank you for the details!
Regards: Bela
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org