FileTarget - KeepFileOpen should watch for file deletion#1878
FileTarget - KeepFileOpen should watch for file deletion#1878304NotModified merged 3 commits intoNLog:masterfrom
Conversation
bb0ce20 to
17bc854
Compare
Current coverage is 81% (diff: 79%)@@ master #1878 diff @@
==========================================
Files 276 276
Lines 18636 18691 +55
Methods 2861 2862 +1
Messages 0 0
Branches 2139 2157 +18
==========================================
+ Hits 15160 15204 +44
- Misses 2971 2973 +2
- Partials 505 514 +9
|
…tive appenders. Deactivate background timer when no active appenders.
ac975f9 to
fcb007b
Compare
…tive appenders. Deactivate background timer when no active appenders (Test)
fcb007b to
a7295af
Compare
|
I think this one also fixes #298 ? |
The MultiFileWatcher.NotifyFilters for the Reload-Timer is different from the MultiFileWatcher.NotifyFilters for the Archive-Folder. So I don't know. |
|
Reviewed 1 of 4 files at r1, 2 of 4 files at r2. src/NLog/Internal/MultiFileWatcher.cs, line 179 at r2 (raw file):
I think .Warn is better? (twice) src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 122 at r2 (raw file):
why not .Equals(..., .OrdinalIgnoreCase)? src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 124 at r2 (raw file):
Duplicate code (4 lines) src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 138 at r2 (raw file):
partly duplicate code. src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 160 at r2 (raw file):
no need to fall back to src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 176 at r2 (raw file):
why the order change? Is this to prevent to preform the cleanup twice? Don't we need a lock in that case? src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 269 at r2 (raw file):
is this change necessary? Or an enhancement? src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 293 at r2 (raw file):
two watches is by design? src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 319 at r2 (raw file):
idem, is this change necessary? Or an enhancement? src/NLog/Internal/FileAppenders/FileAppenderCache.cs, line 339 at r2 (raw file):
nice improvement :) tests/NLog.UnitTests/Targets/FileTargetTests.cs, line 3300 at r2 (raw file):
why are we doing this if we like to flush? Comments from Reviewable |
|
Reviewed 2 of 4 files at r2. Comments from Reviewable |
|
Thanks, reviewed it! I'm a bit cautious with the changes in the fileAppenderCache, as I don't have worked a lot with it |
I have just noticed the bug-reports about using archiving together with keepFileOpen, and gets into the locked-file-handle problems. Not high priority for me, so can easily wait for NLog 5 (or 6) |
Think that's not necessary, I'm just asking more questions in the review. ;) |
…tive appenders. Deactivate background timer when no active appenders (Review)
a9866d5 to
4eb15e7
Compare
|
Reviewed 1 of 2 files at r3. Comments from Reviewable |
|
LGTM Review status: all files reviewed at latest revision, 11 unresolved discussions, some commit checks failed. Comments from Reviewable |
|
\0/ 3 closed issues \0/ \0/ |
KeepFileOpen should watch for file deletes/renames and close active appenders. Deactivate background monitoring when no active appenders.
(Should) fixes #1826, fixes #1856, fixes #1866
This change is