Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix inject the pattern in the archive file name pattern so that even if user do not provide pattern in file name , code will inject it.
How the archiving is done is depend on three variables :
ArchiveEvery : Specifies Time period
ArchiveAboveSize : Specifies size
MaxArchiveFiles : Specifies maximum archived files to keep.
There are three cases mainly :
(1) Lets say developer has set ArchiveEvery to hour and ArchiveAboveSize to 10 MB
So , Whatever condition occurs first , then NLog will start archiving the current log file , in this case numbering is required otherwise NLog will overwrite the previous archive file.
(2) Lets say developer has set ArchiveEvery to none (default) and ArchiveAboveSize to 10 MB
So , in this case if the current log file's size is going to increase above 10 MB , then it will move this file to archive and create a new log file , in this case also we require numbering. Otherwise NLog will overwrite the previous file that was created when the size first increased.
(3) Lets say developer has set ArchiveEvery to hour and ArchiveAboveSize to -1(default)
So , in this case if the hour passed then regardless of the size of the log file , it will be moved to the archive . So , numbering is required. So After second hour if NLog archive the file then it should not overwrite the file that was created after completion of first hour.So , Numbering is required.
In all cases Numbering is required , because NLog will archive file upto MaxArchiveFiles specified.and We don't want to overwrite them.