Closed pregoli closed 3 years ago
One option to achieve this is by accepting a custom ITextFormatter
to override the default formatter.
Thanks for your reply but I'm talking about serilog-sinks-mongodb. If you take a look at the source code it's creating the bsonDocument from the logEvent object. There are no available params to ignore some properties.
Ah, that's right - forgot MongoDB is BSON 👍 Thanks!
can anyone help me in removing "MessageTemplate" property here? I'm not able to understand the resolution from comments My simple 3 line code
IMongoDatabase database = client.GetDatabase("log");
Log.Logger = new LoggerConfiguration().WriteTo.MongoDB(database).CreateLogger();
Log.Information("This is test log {proper}",1);
Please try the latest with the MongoDBBson() sink.
I'm still confused. has it done?
It is not possible to avoid to write the "MessageTemplate" property. It s only possible to remove custom ones.