Skip to content

Support prefix date formatting for rolling log filenames #358

@DawnTreader

Description

@DawnTreader

Currently, the File sink with rollingInterval appends the date as a suffix to the log filename (e.g. edonexuscore20251130.log).

In some environments, we need the date/time as a prefix instead, to make log files easier to sort and scan (e.g. 2025-11-30 15-25-28 edonexuscore.log).

Right now, the only way to achieve this is to manually generate a timestamped filename and drop rollingInterval, which means losing automatic daily rotation.

Feature request: Add support for configurable filename formatting in the File sink, including the ability to place the rolling date before the base filename.

Example desired behavior:

text
2025-11-30 edonexuscore.log
2025-12-01 edonexuscore.log
or with time granularity:

text
2025-11-30 15-25-28 edonexuscore.log
This would allow us to keep both prefix‑style timestamps and Serilog’s rolling interval rotation.

Thanks for considering — this would make log management much more flexible for teams that prefer prefix‑based naming conventions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions