15

The Current Output of RollingFile Sink for Date time is as follows

2015-04-06 18:40:54.400 +10:00 [Information] Hello World!

Is there anyway to remove the TimeZone Offset? +10:00. To Achieve the following output;

2015-04-06 18:40:54.400 [Information] Hello World!

In my case, the timezone offset is superfluous fluff which is just cluttering my Text Log.

serenesat
  • 4,611
  • 10
  • 37
  • 53
Aaron Glover
  • 1,199
  • 2
  • 13
  • 30

1 Answers1

35

You can specify the outputTemplate parameter to the .RollingFile() configuration method:

.WriteTo.RollingFile(
    outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level}] {Message}{NewLine}{Exception}")
Nicholas Blumhardt
  • 30,271
  • 4
  • 90
  • 101