Skip to content

Windows Service restart causing _001, _002, _003 files. #61

@piotrzaremba

Description

@piotrzaremba

I currently have the following Ilogger configuartion.

return new LoggerConfiguration().Enrich.With().Filter.ByExcluding(ev => !fixieOptions.IsSerilogEnabled).MinimumLevel.Debug().WriteTo.Async(appender => appender.File(Path.Combine($"{AppDomain.CurrentDomain.BaseDirectory}\..\logs", "telemetry", "telemetry..log"), rollingInterval: RollingInterval.Day,outputTemplate: "{UtcTimestamp}|{Level:u3}|{Message:lj}{NewLine}{Exception}")).CreateLogger();

Each time I restart my windows service a new file is created and appended with a sequence number. The issue is that on another windows service the same configuration is used and when that service is restarted NO new file is created. How do I prevent the _001..._00n sequence files from getting created. I want a single file per day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions