Serilog.Sinks.AmazonS3
Serilog.Sinks.AmazonS3 copied to clipboard
AmazonS3 is not able to read the formatter parameter.
var logger = new LoggerConfiguration()
.WriteTo.AmazonS3(
formatter:new CompactJsonFormatter(),
path,
bucketName,
Amazon.RegionEndpoint.APSouth1,
awsAccessKey,
awsSecretKey,
LogEventLevel.Information,
"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
new CultureInfo("en-US"),
levelSwitch,
Serilog.Sinks.AmazonS3.RollingInterval.Minute,
Encoding.Unicode,
e => Console.WriteLine($"An error occurred in my sink: {e.Message}"),
bucketPath,
eagerlyEmitFirstEvent:false
)
.CreateLogger();