[ 
https://issues.apache.org/jira/browse/LOG4J2-3406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Piotr P. Karwasz updated LOG4J2-3406:
-------------------------------------
    Description: 
The properties configuration syntax requires a lot of additional properties to 
specify a component's name or type. On the other hand a lot of random 
identifiers must be generated to provide unique prefixes to each component in a 
list.

I open this ticket to discuss the possibility of extending the properties 
format and use the unique identifier as default component's name. E.g. as an 
alternative to:
{noformat}
appender.<1234>.type = Console
appender.<1234>.name = STDOUT
{noformat}
we might write:
{noformat}
appender.STDOUT.type = Console
{noformat}
This is already implemented for the {{<Properties>}} and {{<CustomLevels>}} 
elements, where the identifier *is* the name of the property.

Given that [~rgoers]'s solution to LOG4J2-3341 introduced a real property 
{{levelAndRefs}} for the logger components, we might also allow identifiers 
containing dots for loggers (if the property ends in {{{}.levelAndRefs{}}}). To 
find the identifiers of all loggers we might use the following rule:
 * if there is a property {{logger.foo}} (these were ignored in 2.17.1), 
{{foo}} is an identifier and the property is equivalent to 
{{{}logger.foo.levelAndRefs{}}},
 * if there is a property {{{}logger.foo.name{}}}, {{foo}} is an identifier 
(this was the unique rule in 2.17.1),
 * if there is a property {{logger.foo.bar.baz.levelAndRefs}} or 
{{{}logger.foo.bar.baz.level{}}}, then {{foo.bar.baz}} is an identifier,

  was:
The properties configuration syntax requires a lot of additional properties to 
specify a component's name or type. On the other hand a lot of random 
identifiers must be generated to provide unique prefixes to each component in a 
list.

I open this ticket to discuss the possibility of extending the properties 
format and use the unique identifier as default component's name. E.g. as an 
alternative to:
{noformat}
appender.<1234>.type = Console
appender.<1234>.name = STDOUT
{noformat}
we might write:
{noformat}
appender.STDOUT.type = Console
{noformat}
This is already implemented for the {{<Properties>}} and {{<CustomLevels>}} 
elements, where the identifier *is* the name of the property.

Given that [~ggregory]'s solution to LOG4J2-3341 introduced a real property 
{{levelAndRefs}} for the logger components, we might also allow identifiers 
containing dots for loggers (if the property ends in {{{}.levelAndRefs{}}}). To 
find the identifiers of all loggers we might use the following rule:
 * if there is a property {{logger.foo}} (these were ignored in 2.17.1), 
{{foo}} is an identifier and the property is equivalent to 
{{{}logger.foo.levelAndRefs{}}},
 * if there is a property {{{}logger.foo.name{}}}, {{foo}} is an identifier 
(this was the unique rule in 2.17.1),
 * if there is a property {{logger.foo.bar.baz.levelAndRefs}} or 
{{{}logger.foo.bar.baz.level{}}}, then {{foo.bar.baz}} is an identifier,


> Implicit component names in the properties format
> -------------------------------------------------
>
>                 Key: LOG4J2-3406
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3406
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Configurators
>    Affects Versions: 2.17.1
>            Reporter: Piotr P. Karwasz
>            Priority: Minor
>
> The properties configuration syntax requires a lot of additional properties 
> to specify a component's name or type. On the other hand a lot of random 
> identifiers must be generated to provide unique prefixes to each component in 
> a list.
> I open this ticket to discuss the possibility of extending the properties 
> format and use the unique identifier as default component's name. E.g. as an 
> alternative to:
> {noformat}
> appender.<1234>.type = Console
> appender.<1234>.name = STDOUT
> {noformat}
> we might write:
> {noformat}
> appender.STDOUT.type = Console
> {noformat}
> This is already implemented for the {{<Properties>}} and {{<CustomLevels>}} 
> elements, where the identifier *is* the name of the property.
> Given that [~rgoers]'s solution to LOG4J2-3341 introduced a real property 
> {{levelAndRefs}} for the logger components, we might also allow identifiers 
> containing dots for loggers (if the property ends in {{{}.levelAndRefs{}}}). 
> To find the identifiers of all loggers we might use the following rule:
>  * if there is a property {{logger.foo}} (these were ignored in 2.17.1), 
> {{foo}} is an identifier and the property is equivalent to 
> {{{}logger.foo.levelAndRefs{}}},
>  * if there is a property {{{}logger.foo.name{}}}, {{foo}} is an identifier 
> (this was the unique rule in 2.17.1),
>  * if there is a property {{logger.foo.bar.baz.levelAndRefs}} or 
> {{{}logger.foo.bar.baz.level{}}}, then {{foo.bar.baz}} is an identifier,



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to