NLog / NLog/NLog

NLog LogEventInfo TimeStamp should default to DateTime.UtcNow

Open
#5,899 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking change
Dominant language
C#
Stars
6.5k
Forks
1.4k
Avg merge
9h 17m
Merged PRs (30d)
24

Description

It is annoying that one must always remember to specify correct NLog Time-Source to get accurate timings:

<time type="AccurateUtc" />

https://github.com/NLog/NLog/wiki/Time-Source

Instead NLog should change so it uses AccurateUtc by default, but support changing timestamp-output to be local-time (default) or utc-time (explicit). Similar to being able to change the default-culture on LoggingConfiguration / LogFactory, then it should be possible to change the default-time-zone (default local)

The overhead of converting from UTC-time to Local-time should only apply to targets that requests Local-time output using ${date} / ${longdate} / ${time} / etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LogEventInfo and the Time-Source documentation linked in the issue, then trace how timestamps are created and how ${date}, ${longdate}, and ${time} request output. Define how UTC storage, local-time output, AccurateUtc defaults, and configurable default time zones should interact; done means the behavior is specified and covered for the mentioned output modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.