Skip to content

Commit 1213d13

Browse files
committed
compile the regex
1 parent 9a0257e commit 1213d13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Serilog.Sinks.File/Sinks/File/PathRoller.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public PathRoller(string path, RollingInterval interval)
5252
"(?<" + PeriodMatchGroup + ">\\d{" + _periodFormat.Length + "})" +
5353
"(?<" + SequenceNumberMatchGroup + ">_[0-9]{3,}){0,1}" +
5454
Regex.Escape(_filenameSuffix) +
55-
"$");
55+
"$",
56+
RegexOptions.Compiled);
5657

5758
DirectorySearchPattern = $"{_filenamePrefix}*{_filenameSuffix}";
5859
}

0 commit comments

Comments
 (0)