I have configured a logger using Serilog
_logger = new LoggerConfiguration()
.WriteTo.File(new JsonFormatter(), configuration["loggerPath"],
rollingInterval:RollingInterval.Day)
.CreateLogger()
Then I try to log sample information with method:
public void Info(AdditionalInfo additionalInfo)
{
_logger.Information("{EventCategory} {Process}", additionalInfo.EventCategory, additionalInfo.Process);
}
The information is logged and I am satisisfied. However, I do not think I need MessageTemplate property in my log. Also it is additional information to store. Is it possible to tell Serilog not to display it? If not, why is it necessary?
{"Timestamp":"2020-08-11T17:17:01.9862562+02:00","Level":"Information","MessageTemplate":"{EventCategory} {Process}",
"Properties":{"EventCategory":"Category","Process":"Tests"}}