NLog LogEventInfo TimeStamp should default to DateTime.UtcNow
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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