Hi,
I have a problem regarding limiting the number of log files.
I have retainedFileCountLimit 2, but map seems to ignore this rule. Unfortunately it creates more than 2 files.
.WriteTo.Async(a =>
{
a.Map<string>(
e => DateTime.Now.ToString("dd_MM_yyyy"),
(v, wt) => wt.File($"{AppDomain.CurrentDomain.BaseDirectory}/logs/log_{v}.txt",
retainedFileCountLimit: 2,
outputTemplate: "[{Timestamp:dd/MM/yyyy HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
buffered: true,
fileSizeLimitBytes: 105000000),
sinkMapCountLimit: 1);
}, bufferSize: 120000)
it should only have been 2 files, but I see 3 files:
log_15_05_2021.txt
log_16_05_2021.txt
log_17_05_2021.txt
Hi,
I have a problem regarding limiting the number of log files.
I have retainedFileCountLimit 2, but map seems to ignore this rule. Unfortunately it creates more than 2 files.
it should only have been 2 files, but I see 3 files: