Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Comment out SelfLog for now as requested
  • Loading branch information
Falco20019 committed Feb 27, 2025
commit 455a10f76f73babf33fd9c097b7e5386b900cbae
2 changes: 2 additions & 0 deletions src/Serilog.Sinks.File/Sinks/File/RollingFileSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ public void Emit(LogEvent logEvent)
AlignCurrentFileTo(now, nextSequence: true);
}

/* TODO: We REALLY should add this to avoid stuff become missing undetected.
if (_currentFile == null)
{
SelfLog.WriteLine("Log event {0} was lost since it was not possible to open the file or create a new one.", logEvent.RenderMessage());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about doing this under the lock, since SelfLog may be writing somewhere slow. Might be safer to drop this for now, and reconsider separately.

Copy link
Contributor Author

@Falco20019 Falco20019 Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that, I just had issues already that stuff was lost and we never found out why. But will remove it to progress with the PR for now. This should really never happen on regular use-cases and therefore should be neglectable and if the file was locked, we also use the SelfLog, so it was the nearest thing to consider :)

I will just comment it out so that it's easy to add in the future.

*/
}
}

Expand Down