When messages get written into the nsb logs (nsb_yy-mm-dd_X.txt), they are always written in the time zone that's set on the OS (in this case on a Windows 2019 Enterprise box, Americas/New York). Sample Below:
2022-03-25 16:19:26.790 INFO Received PlaceOrder, OrderId 79308f8a-5fef-49d0-bc86-c886f57f1472
The only way I can change the nsb logs where the timestamp is written in UTC form is to configure the date/time setting on the OS to UTC. What I want to know is whether or not it's possible to write the NSB logs in UTC time WITHOUT setting the OS date/time to UTC? I want to send these log entries into ElasticSearch but when the timestamp is passed, it treats the timestamp as UTC and when I view it in Kibana, the timestamp is 4 hours behind.
I have tried other methods in fluent-bit and fluentd to adjust the timestamp off the NSB logs (lua script in fluent-bit, set Time_Offset in fluent-bit, use_utc_timekey in fluentd, etc) but to no avail. It doesn't adjust the timestamp value to UTC.
The only place I see in the source code in nservicebus is the DefaultLoggerFactory.cs file where I see the format of the timestamp that looks like the same as the nsb logs.
Thanks.
- Changed Windows OS in nservicebus application to UTC (this works but I don't want to do this)
- Used lua script in fluent-bit to adjust timestamp value in log entry
- Added a use_utc_timekey set to true to send the log entry to my S3 bucket in fluentd