vy commented on issue #4015:
URL: 
https://github.com/apache/logging-log4j2/issues/4015#issuecomment-3699449976

   > Regarding your suggestion to introduce a delegating layout that masks the 
output of layout.encode(logEvent): I see the value in that approach, especially 
for composability across different layouts (JSON, XML, etc.). However, I need 
to do some internal research and testing to understand the performance and 
implementation details of a delegating layout.
   
   @Neel1210, I'd appreciate it if you can quickly check the feasibility of 
this at your side.
   
   I don't think anything can be slower than what we already have in 
`PatternLayout`:
   
   ```
   String str = buffer.toString();
   str = replace.format(str);
   ```
   
   By moving this logic to a dedicated generalized component, we can achieve
   
   - Garbage-free replacements
   - Layout-agnostic usability
   - Home for further utilities (e.g., concatenating output from multiple 
layouts)
   
   > In the meantime, I feel that expanding the existing RegexReplacement in 
PatternLayout is a viable short-term improvement or should we focus exclusively 
on the delegating layout approach?
   
   I am not really sure if we can overload `replace` to accept both 
`RegexReplacement` and `RegexReplacement[]`. I don't even know how to represent 
this in XSD. I'm also reluctant to add more knobs to `PatternLayout`. But that 
is me.
   
   @ppkarwasz, WDYT?


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