2020-03-11 18:13:56.005 +05:30 DESKTOP-4EE5SF ZZZ [INF] Logging started.
Above log message is given when event is logged to file using serilog.
Log.Logger = new LoggerConfiguration()
.WriteTo.File("",
rollingInterval: RollingInterval.Day,
fileSizeLimitBytes: 1024 * 100,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {MachineName} ZZZ[{Level:u3}] {Message:lj}{NewLine}{Exception})
.CreateLogger();
Log.Information("Logging started.");
how do I get same output using Serilog HTTP logger something like below
.WriteTo.Http(ConfigurationManager.AppSettings["httpLoggingPath"],
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {MachineName} ZZZ[{Level:u3}] {Message:lj}{NewLine}{Exception})
You can't, the sink doesn't support output templates.
My take on output templates is that they are suited for sinks that produce an output to the user. The HTTP sink is more of a necessity for distributed computing when one wish to centralize the log events using a log server, e.g. Logstash.
I would really like to help you out. Can we move this discussion over to a new issue on the GitHub repository?