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., 
using {time} placeholders with named parameters in JSON output) isn't something 
log4net supports natively.

As far as I know, log4net doesn't parse message templates like "Started {time}" 
in the same way that libraries like Serilog do. Instead, it expects traditional 
.NET format strings with positional arguments (e.g., {0}, {1}, etc.), which is 
likely why you're seeing the System.FormatException.

If you've seen this working elsewhere or have a reference to how it might be 
done in log4net, I'd be really interested to see it—maybe there's an extension 
or approach I'm not aware of.

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

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

Reply via email to