Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. For example, "I'd like to do x but currently I can't because y [...]".
- At the beginning of the project, my configuration was like this,72 log files will be retained
configuration
.WriteTo.File($"Logs/log-.log",
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 72 ,
shared: false,
outputTemplate: temp);
- Since the log file is relatively large, compression is used for archiving.
my configuration was like this,2 log files will be retained and 70 compressed log files, ArchiveHooks
configuration
.WriteTo.File($"Logs/log-.log",
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 2,
shared: false, hooks: new ArchiveHooks(70),
outputTemplate: temp);
|
_hooks?.OnFileDeleting(fullPath); |
- Everything looked fine, but when I upgraded the program to a production environment, the program blocked on startup. Unable to complete startup after several minutes
- The first startup after the program upgrade requires compressing 70 files, which takes a lot of time. The program will be blocked until this deleting work is completed
Describe the solution you'd like
Archive files are usually compressed or copied, which takes a lot of time. During this period, the main program should not be blocked from starting. Async to remove old log file supported
|
System.IO.File.Copy(path, newFile, false); |
Describe alternatives you've considered
A clear and concise description of any workarounds or alternative solutions you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. For example, "I'd like to do x but currently I can't because y [...]".
my configuration was like this,2 log files will be retained and 70 compressed log files, ArchiveHooks
serilog-sinks-file/src/Serilog.Sinks.File/Sinks/File/RollingFileSink.cs
Line 206 in 2a61b4b
Describe the solution you'd like
Archive files are usually compressed or copied, which takes a lot of time. During this period, the main program should not be blocked from starting. Async to remove old log file supported
serilog-sinks-file/test/Serilog.Sinks.File.Tests/Support/ArchiveOldLogsHook.cs
Line 20 in 2a61b4b
Describe alternatives you've considered
A clear and concise description of any workarounds or alternative solutions you've considered.
Additional context
Add any other context or screenshots about the feature request here.