Skip to content

Add UTC timestamp to log entries and clean up first log line - #140

Merged
mrkline merged 3 commits into
UOAF:developfrom
Fratee:improve_include-UTC-timestamps-in-logs
Nov 27, 2026
Merged

mrkline merged 3 commits into
UOAF:developfrom
Fratee:improve_include-UTC-timestamps-in-logs

Conversation

@Fratee

@Fratee Fratee commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Changes log timestamp from

1.093 [INF] [] OpenFreq Client 0.0.0-local starting at 2026-11-07T09:50:11.6845731+01:00
7.089 [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Mutex acquired - RCS owner
7.091 [DBG] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Creating RCS shared memory...
7.093 [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] RCS shared memory created, flags cleared

to

2026-11-07T09:35:44.095Z (1.093) [INF] [] OpenFreq Client 0.0.0-local
2026-11-07T09:35:44.803Z (7.089) [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Mutex acquired - RCS owner
2026-11-07T09:35:44.805Z (7.091) [DBG] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Creating RCS shared memory...
2026-11-07T09:35:44.807Z (7.093) [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] RCS shared memory created, flags cleared

This helps correlate client and server logs, making it easier to match related events.

Fixes #138

@mrkline

mrkline commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

If we want wall time in the log entries again, include both - maybe something like

2026-11-07T09:35:44.803Z (7.089) [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Mutex acquired - RCS owner

?

For anything analyzing the timing between events (like stepper or scripts we might cook up for debugging), you need monotonic time - a clock that always ticks up, hopefully at a consistent rate. Wall time is unreliable - it can jump forward and backwards as NTP adjusts your system clock. And in many places, it teleports an hour twice a year due to time zone changes.

I'm not particular about the format so long as monotonic time is there.

@Fratee

Fratee commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

If we want wall time in the log entries again, include both - maybe something like

2026-11-07T09:35:44.803Z (7.089) [INF] [OpenFreq.Client.Services.FalconRadioSharedMemoryService] Mutex acquired - RCS owner

?

For anything analyzing the timing between events (like stepper or scripts we might cook up for debugging), you need monotonic time - a clock that always ticks up, hopefully at a consistent rate. Wall time is unreliable - it can jump forward and backwards as NTP adjusts your system clock. And in many places, it teleports an hour twice a year due to time zone changes.

I'm not particular about the format so long as monotonic time is there.

updated

Comment on lines +27 to +32
public sealed class UtcTimestampEnricher : ILogEventEnricher
{
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) =>
logEvent.AddPropertyIfAbsent(new LogEventProperty("UtcTimestamp",
new ScalarValue(logEvent.Timestamp.UtcDateTime)));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your brain on OOP

@mrkline
mrkline merged commit 8e3107a into UOAF:develop Nov 27, 2026
@Fratee
Fratee deleted the improve_include-UTC-timestamps-in-logs branch November 29, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include UTC timestamps in server logs

2 participants