-
Notifications
You must be signed in to change notification settings - Fork 125
Allow FileLifecycleHooks to change the length of the stream #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
augustoproiete
added a commit
to augustoproiete-forks/serilog--serilog-sinks-file
that referenced
this issue
Nov 4, 2020
augustoproiete
added a commit
to augustoproiete-forks/serilog--serilog-sinks-file
that referenced
this issue
Nov 4, 2020
augustoproiete
added a commit
to augustoproiete-forks/serilog--serilog-sinks-file
that referenced
this issue
Nov 9, 2020
augustoproiete
added a commit
to augustoproiete-forks/serilog--serilog-sinks-file
that referenced
this issue
Nov 12, 2020
augustoproiete
added a commit
to augustoproiete-forks/serilog--serilog-sinks-file
that referenced
this issue
Nov 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently files are opened with
FileMode.Append
, which preventsFileLifecycleHooks
from modifying the size of the stream when implementing anOnFileOpened
hook.In addition, when
fileSizeLimitBytes
is set, the stream is wrapped viaWriteCountingStream
which does not implementSetLength
.Changing the size of the stream can be useful in a few scenarios, such as:
Calling
SetLength
withfileSizeLimitBytes
tonull
throwsSystem.IO.IOException: Unable to truncate data that previously existed in a file opened in Append mode
Calling
SetLength
withfileSizeLimitBytes
to any number throwsSystem.NotSupportedException: Specified method is not supported
The text was updated successfully, but these errors were encountered: