ramanathan1504 commented on PR #4142:
URL: https://github.com/apache/logging-log4j2/pull/4142#issuecomment-4955657665

   > `.properties` logger parsing drops leftover `property.*` keys because 
`createLogger`/`createRootLogger` do not pass remaining properties through 
`processRemainingProperties`. @ppkarwasz in #4024 suggests to forward remaining 
logger properties like appenders already do.
   > 
   >     1. **Blocker:** the PR changes validation semantics. Existing code 
throws for missing appender/filter/logger essentials; the PR returns `null` 
instead for appenders, filters, and loggers. That silently hides malformed 
configs and nested filters can still hit 
`componentBuilder.add(createFilter(...))` without a null check. This is 
unrelated to #4024.
   > 
   >     2. **Blocker:** the prefix-flattening logic is too heuristic. It scans 
for any `*.name` and rewrites the properties map in 
`createAppender`/`createLogger`. That can misinterpret nested component names 
as appender/logger names. `partitionOnCommonPrefixes` already gives the right 
structure for `logger.foo.property.*`, so this machinery should not be needed.
   > 
   >     3. **Regression risk:** named logger levels stop using 
`Strings.trimToNull`; existing tests indicate trailing spaces on logger levels 
are intentional to support.
   > 
   >     4. **Borrowable pieces:** the test assertions checking 
`getRootLogger().getPropertyList()` and named logger `getPropertyList()` are 
useful. Also, the PR notices the empty `""` shorthand key must not be fed into 
`processRemainingProperties`; I’d handle that locally with 
`properties.remove("")`, not by changing the generic parser broadly.
   > 
   > 
   > I recommend to keep appender/filter parsing and validation unchanged; in 
`createLogger` and `createRootLogger`, consume the shorthand `""` key, add 
refs/filters as today, then return `processRemainingProperties(loggerBuilder, 
properties)`. Add focused tests for root logger properties, named logger 
properties, shorthand logger syntax, and preservation of malformed-config 
failures.
   
   @vy 9e99b10


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to