Support for template names #261
Replies: 4 comments 4 replies
-
I am not aware of a possible solution to your problem. |
Beta Was this translation helpful? Give feedback.
-
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 that more people haven't asked for this. Maybe, now that I think about it, there are 2 problems. One, the json output seems incorrect, IE missing the parameter names. And two, the console output throws an error. |
Beta Was this translation helpful? Give feedback.
-
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 method blowing up. Do you think there is anything that can be done with that? |
Beta Was this translation helpful? Give feedback.
-
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 this class to the project and replace the Layout in the file appender.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
I'm currently using the library log4net.Ext.Json to export the json. If this does work, please tell me how, because when I try it, I get the error:
Also, I'm using these libraries.
log4net, version=3.1.0
log4net.Ext.Json, version=3.0.3
log4net.Ext.Json.Net, version=3.0.3
Newtonsoft.Json, version=13.0.3
Beta Was this translation helpful? Give feedback.
All reactions