NLog LogEventInfo TimeStamp should default to DateTime.UtcNow

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

Description

breaking change

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.

Dominant language
C#
Stars
6.5k
Forks
1.4k
Avg merge
1d 10h
Merged PRs (30d)
34

Getting set up

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.

More from NLog/NLog

All issues in NLog/NLog

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.