You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2021/03/04 10:50:15 UTC

[GitHub] [logging-log4j2] vy commented on pull request #472: Allow custom resolvers to be registered for JsonTemplateLayout

vy commented on pull request #472:
URL: https://github.com/apache/logging-log4j2/pull/472#issuecomment-790522511


   Hey @radut! This feature is something definitely on my radar, see [LOG4J2-3004](https://issues.apache.org/jira/browse/LOG4J2-3004). The reason we haven't made resolver registry public is indeed to disallow tampering this static list, until we migrate these to Log4j 2 plugins similar to the one in `PatternLayout`.
   
   Compared to plugins, there are a couple of disadvantages of mutating a static list of resolvers.
   1. They will affect all `JsonTemplateLayout` instantiations, which might not be desirable. Put another way, you cannot change them per `JsonTemplateLayout` instance.
   2. It is not Log4j idiomatic – plugins are the way for extending an existing functionality.
   
   Hence, I will sadly need to reject this change. Though feel free to submit a new PR (or re-open and update this one) adding plugin support to `JsonTemplateLayout`.
   
   Curious about one thing: **What new resolvers were you planing to introduce?** If they address a common need, it is easier to land that into a release compared to a fully-fledged plugin support.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org