Visitar URL original
NLog LogEventInfo TimeStamp should default to DateTime.UtcNow · Issue #5899 · NLog/NLog · GitHub
Skip to content

NLog LogEventInfo TimeStamp should default to DateTime.UtcNow #5899

Open

Description

@snakefoot

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.

Activity

  1. added this to the 7.0 milestone on Jun 24, 2025
  2. snakefoot commented on Jan 22, 2026

    @snakefoot
    ContributorAuthor

    Looks like NET11 (and newer) will improve the granularity of the Environment.TickCount on Windows, so it will match Linux/MacOS and update every 1ms instead of every 16ms:

  3. changed the title [-]NLog LogEventInfo TimeStamp should always be DateTime.UtcNow[/-] [+]NLog LogEventInfo TimeStamp should be DateTime.UtcNow by default[/+] on Apr 9, 2026
  4. changed the title [-]NLog LogEventInfo TimeStamp should be DateTime.UtcNow by default[/-] [+]NLog LogEventInfo TimeStamp should default to DateTime.UtcNow[/+] on Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeBreaking API change (different to semantic change)

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions