OnFileOpened Method

Serilog Sinks AmazonS3

Serilog.Sinks.AmazonS3

FileLifecycleHooks..::..OnFileOpened Method

Initialize or wrap the underlyingStream opened on the log file. This can be used to write file headers, or wrap the stream in another that adds buffering, compression, encryption, etc. The underlying file may or may not be empty when this method is called.

Namespace:  Serilog.Sinks.AmazonS3
Assembly:  Serilog.Sinks.AmazonS3 (in Serilog.Sinks.AmazonS3.dll)

Syntax


[SuppressMessageAttribute]
public virtual Stream OnFileOpened(
	Stream underlyingStream,
	Encoding encoding
)
<SuppressMessageAttribute> _
Public Overridable Function OnFileOpened ( _
	underlyingStream As Stream, _
	encoding As Encoding _
) As Stream
[SuppressMessageAttribute]
public:
virtual Stream^ OnFileOpened(
	Stream^ underlyingStream, 
	Encoding^ encoding
)

Parameters

underlyingStream
Type: Stream
The underlying [Stream] opened on the log file.
encoding
Type: Encoding
The encoding to use when reading/writing to the stream.

Return Value

The [Stream] Serilog should use when writing events to the log file.

Remarks


A value must be returned from overrides of this method. Serilog will flush and/or dispose the returned value, but will not dispose the stream initially passed in unless it is itself returned.