You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "FreeAndNil (via GitHub)" <gi...@apache.org> on 2025/07/01 05:49:14 UTC

Re: [D] Support for template names [logging-log4net]

GitHub user FreeAndNil added a comment to the discussion: Support for template names

Have you tried your solution?
You can easily exchange the PatternLayout with your own layout in the log4net configuration: https://logging.apache.org/log4net/manual/configuration/layouts.html

In case you log many events in a short time, be careful not to produce too much garbage for the garbage collector.
Now you have at least six more objects in your hot path for **every** log event:
- 1 Regex (could be cached as static readonly)
- 1 MatchCollection
- 1 List
- 1 TemplateWithValue
- 1 Dictionary
- 1 JsonSerializer (could also be cached static)

GitHub link: https://github.com/apache/logging-log4net/discussions/261#discussioncomment-13625013

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org