Skip to content

Commit

Permalink
Merge pull request #111 from SimonCropp/compiledRegex
Browse files Browse the repository at this point in the history
Compile the rolling file set path matching regex
  • Loading branch information
nblumhardt authored Aug 25, 2019
2 parents 9a0257e + 1213d13 commit 5b52dd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Serilog.Sinks.File/Sinks/File/PathRoller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public PathRoller(string path, RollingInterval interval)
"(?<" + PeriodMatchGroup + ">\\d{" + _periodFormat.Length + "})" +
"(?<" + SequenceNumberMatchGroup + ">_[0-9]{3,}){0,1}" +
Regex.Escape(_filenameSuffix) +
"$");
"$",
RegexOptions.Compiled);

DirectorySearchPattern = $"{_filenamePrefix}*{_filenameSuffix}";
}
Expand Down

0 comments on commit 5b52dd2

Please sign in to comment.