AmazonS3 Method

Serilog Sinks AmazonS3

Serilog.Sinks.AmazonS3

LoggerConfigurationAmazonS3Extensions..::..AmazonS3 Method

Write log events to the specified file.

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

Syntax


public static LoggerConfiguration AmazonS3(
	LoggerSinkConfiguration sinkConfiguration,
	string path,
	string bucketName,
	RegionEndpoint endpoint,
	string awsAccessKeyId,
	string awsSecretAccessKey,
	LogEventLevel restrictedToMinimumLevel,
	string outputTemplate,
	IFormatProvider formatProvider,
	Nullable<long> fileSizeLimitBytes,
	LoggingLevelSwitch levelSwitch,
	bool buffered,
	RollingInterval rollingInterval,
	Nullable<int> retainedFileCountLimit,
	Encoding encoding,
	FileLifecycleHooks hooks
)
Public Shared Function AmazonS3 ( _
	sinkConfiguration As LoggerSinkConfiguration, _
	path As String, _
	bucketName As String, _
	endpoint As RegionEndpoint, _
	awsAccessKeyId As String, _
	awsSecretAccessKey As String, _
	restrictedToMinimumLevel As LogEventLevel, _
	outputTemplate As String, _
	formatProvider As IFormatProvider, _
	fileSizeLimitBytes As Nullable(Of Long), _
	levelSwitch As LoggingLevelSwitch, _
	buffered As Boolean, _
	rollingInterval As RollingInterval, _
	retainedFileCountLimit As Nullable(Of Integer), _
	encoding As Encoding, _
	hooks As FileLifecycleHooks _
) As LoggerConfiguration
public:
static LoggerConfiguration^ AmazonS3(
	LoggerSinkConfiguration^ sinkConfiguration, 
	String^ path, 
	String^ bucketName, 
	RegionEndpoint^ endpoint, 
	String^ awsAccessKeyId, 
	String^ awsSecretAccessKey, 
	LogEventLevel^ restrictedToMinimumLevel, 
	String^ outputTemplate, 
	IFormatProvider^ formatProvider, 
	Nullable<long long^> fileSizeLimitBytes, 
	LoggingLevelSwitch^ levelSwitch, 
	bool^ buffered, 
	RollingInterval^ rollingInterval, 
	Nullable<int^> retainedFileCountLimit, 
	Encoding^ encoding, 
	FileLifecycleHooks^ hooks
)

Parameters

sinkConfiguration
Type: LoggerSinkConfiguration
Logger sink configuration.
path
Type: String
Path to the file.
bucketName
Type: String
The Amazon S3 bucket name.
endpoint
Type: RegionEndpoint
The Amazon S3 endpoint.
awsAccessKeyId
Type: String
The Amazon S3 access key id.
awsSecretAccessKey
Type: String
The Amazon S3 access key.
restrictedToMinimumLevel
Type: LogEventLevel
The minimum level for events passed through the sink. Ignored when levelSwitch is specified.
outputTemplate
Type: String
A message template describing the format used to write to the sink. the default is "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}".
formatProvider
Type: IFormatProvider
Supplies culture-specific formatting information, or null.
fileSizeLimitBytes
Type: Nullable<(Of <(<'Int64>)>)>
The approximate maximum size, in bytes, to which a log file will be allowed to grow. For unrestricted growth, pass null. The default is 1 GB. To avoid writing partial events, the last event within the limit will be written in full even if it exceeds the limit.
levelSwitch
Type: LoggingLevelSwitch
A switch allowing the pass-through minimum level to be changed at runtime.
buffered
Type: Boolean
Indicates if flushing to the output file can be buffered or not. The default is false.
rollingInterval
Type: Serilog.Sinks.AmazonS3..::..RollingInterval
The interval at which logging will roll over to a new file.
retainedFileCountLimit
Type: Nullable<(Of <(<'Int32>)>)>
The maximum number of log files that will be retained, including the current log file. For unlimited retention, pass null. The default is 31.
encoding
Type: Encoding
Character encoding used to write the text file. The default is UTF-8 without BOM.
hooks
Type: Serilog.Sinks.AmazonS3..::..FileLifecycleHooks
Optionally enables hooking into log file lifecycle events.

Return Value

Configuration object allowing method chaining.