cocowalla / serilog-sinks-file-archive

Plugin for the Serilog File sink that works with rolling log files, archiving completed log files before they are deleted by Serilog's retention mechanism
Apache License 2.0
31 stars 7 forks source link

Archive directory path is ignored #13

Closed blazsvigelj closed 1 year ago

blazsvigelj commented 1 year ago

When calling ArchiveHooks with retainedFileCountLimit the target directory is ignored.

Fore example: new ArchiveHooks(3, CompressionLevel.Fastest, "/archive"); will never move compressed files in /archive folder.

Possible solution: https://github.com/cocowalla/serilog-sinks-file-archive/blob/d3a20bbba4282284aedd174f25f296ddac097af8/src/Serilog.Sinks.File.Archive/ArchiveHooks.cs#L50

should be this.targetDirectory = targetDirectory;

cocowalla commented 1 year ago

@blazsvigelj thanks for finding this, it's now been fixed and a new version pushed: https://www.nuget.org/packages/Serilog.Sinks.File.Archive/1.0.3