GitHub user martinRocks added a comment to the discussion: Support for template
names
I have tried it. It seems to get me what I need in the json, however, the
console still blows up with the error. My next step is to test it with splunk.
However, I have to wait for my IT guys to get that
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
GitHub user martinRocks added a comment to the discussion: Support for template
names
What do you think about doing something like this? I'm not sure if any of the
names are something that my cloud log reader would ingest, but that should fix
part of my problem. To make this work, just add t
GitHub user FreeAndNil added a comment to the discussion: Support for template
names
There are some possibilities:
You can
- derive your own `LoggingEvent`
- override `RenderedMessage` and `WriteRenderedMessage` (with your special
format logic)
- derive your own logger
- override `ForcedLog`
GitHub user martinRocks added a comment to the discussion: Support for template
names
Thank you so very much for the detailed and quick response. I have an idea on
how to get it to work. If it works, I will share what I have with you.
However, there is still the problem of the StringFormat
GitHub user FreeAndNil added a comment to the discussion: Support for template
names
Thanks for the detailed explanation and the sample app.
I believe there might be a misunderstanding regarding how log4net handles
message templates. The kind of structured logging you're describing (e.g.,
us
GitHub user martinRocks added a comment to the discussion: Support for template
names
Thank you for the quick reply. I have created a small demo app for how I have
things configured. If I have anything set wrong, please let me know. I hope
this helps explain my problem. I am surprised tha
GitHub user FreeAndNil added a comment to the discussion: Support for template
names
I am not aware of a possible solution to your problem.
@gdziadkiewicz do you have an idea?
GitHub link:
https://github.com/apache/logging-log4net/discussions/261#discussioncomment-13599719
This is an au
GitHub user martinRocks edited a discussion: Support for template names
When will log4net allow the use of template names? For example, a log message
like this:
```_log.InfoFormat("Started {time}", DateTime.Now);```
so that the message comes out in Json format like this:
```
{
"date": "2025-