Skip to content

Rolling count added amidst the extension #351

@Falco20019

Description

@Falco20019

Description
If a file name contains multiple dots, the rolling is added before the last dot instead of the first one.

Reproduction

  • Add a configuration with .File("MyFile.ext1.ext2", fileSizeLimitBytes: 1, rollOnFileSizeLimit: true, retainedFileCountLimit: 10)
  • Add two log entries (doesn't matter)
  • See two files like MyFile.ext1.ext2 and MyFile.ext1_001.ext2

Expected behavior

  • See two files like MyFile.ext1.ext2 and MyFile_001.ext1.ext2

Relevant package, tooling and runtime versions
Serilog.Sinks.File 6.0.1

Additional context
We added GZip hook and changed the file extension to .clef.gz and therefore we now have .clef_xxx.gz files, which our tooling is not fine with. Technically this is correct and the default behavior of Path.GetExtension, but it would be great to have it configurable (directory + file name + file extension) as the PathRoller already does internally support it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions