HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 1.0.0

Serilog.Sinks.AmazonS3 is a library to save logging information from https://github.com/serilog/serilog to https://aws.amazon.com/s3/.
The idea there was to upload log files to https://aws.amazon.com/s3/ to later evaluate them with https://aws.amazon.com/emr/ services.
The assembly was written and tested in .Net Framework 4.8 and .Net Standard 2.0.
This project makes use of the https://github.com/serilog/serilog-sinks-file's code in a major part,
so thanks to all the https://github.com/serilog/serilog-sinks-file/graphs/contributors of this project :thumbsup:.

There is a newer version of this package available.
See the version list below for details.
Install-Package HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 -Version 1.0.0
dotnet add package HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 --version 1.0.0
<PackageReference Include="HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 as a Cake Addin
#addin nuget:?package=HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3&version=1.0.0

// Install HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3 as a Cake Tool
#tool nuget:?package=HaemmerElectronics.SeppPenner.Serilog.Sinks.AmazonS3&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Serilog.Sinks.AmazonS3

Serilog.Sinks.AmazonS3 is a library to save logging information from Serilog to Amazon S3. The idea there was to upload log files to Amazon S3 to later evaluate them with Amazon EMR services. The assembly was written and tested in .Net Framework 4.8 and .Net Standard 2.0. This project makes use of the Serilog.Sinks.File's code in a major part, so thanks to all the contributors of this project 👍.

Build status GitHub issues GitHub forks GitHub stars GitHub license Nuget NuGet Downloads Known Vulnerabilities

Available for

  • NetFramework 4.5
  • NetFramework 4.6
  • NetFramework 4.6.2
  • NetFramework 4.7
  • NetFramework 4.7.2
  • NetFramework 4.8
  • NetStandard 2.0

Basic usage:

var logger = new LoggerConfiguration().WriteTo
    .AmazonS3(
        "log.txt",
        "mytestbucket-aws",
        Amazon.RegionEndpoint.EUWest2,
        "ABCDEFGHIJKLMNOP",
        "c3fghsrgwegfn://asdfsdfsdgfsdg",
        fileSizeLimitBytes: 200,
        rollingInterval: RollingInterval.Minute)
    .CreateLogger();

    for (var x = 0; x < 200; x++)
    {
        var ex = new Exception("Test");
        logger.Error(ex.ToString());
    }

The project can be found on nuget.

Configuration options:

|Parameter|Meaning|Example|Default value| |-|-|-|-| |path|The main log file name used.|"log.txt"|None, is mandatory.| |bucketName|The name of the Amazon S3 bucket to use. Check: https://docs.aws.amazon.com/general/latest/gr/rande.html.|`"mytestbucket-aws"`|None, is mandatory.| |endpoint|The Amazon S3 endpoint location.|RegionEndpoint.EUWest2|None, is mandatory.| |awsAccessKeyId|The Amazon S3 access key id.|ABCDEFGHIJKLMNOP|None, is mandatory.| |awsSecretAccessKey|The Amazon S3 secret access key.|c3fghsrgwegfn://asdfsdfsdgfsdg|None, is mandatory.| |restrictedToMinimumLevel|The minimum level for events passed through the sink. Ignored when levelSwitch is specified. Check: https://github.com/serilog/serilog/blob/dev/src/Serilog/Events/LogEventLevel.cs.|`LogEventLevel.Information`|`LogEventLevel.Verbose`| |outputTemplate|A message template describing the format used to write to the sink.|"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"|"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"| |formatProvider|The IFormatProvider to use. Supplies culture-specific formatting information. Check: https://docs.microsoft.com/en-us/dotnet/api/system.iformatprovider?view=netframework-4.8.|`new CultureInfo("de-DE")|null| |fileSizeLimitBytes|The number of bytes in a file. The sink rolls to a new file after the limit is reached.|200|1L * 1024 * 1024 * 1024| |levelSwitch|A switch allowing the pass-through minimum level to be changed at runtime. Check: https://nblumhardt.com/2014/10/dynamically-changing-the-serilog-level/.|var levelSwitch = new LoggingLevelSwitch(); levelSwitch.MinimumLevel = LogEventLevel.Warning;|null| |buffered|Indicates if flushing to the output file can be buffered or not.|buffered: true|false| |rollingInterval|The interval at which logging will roll over to a new file. Check: https://github.com/serilog/serilog-sinks-file/blob/dev/src/Serilog.Sinks.File/RollingInterval.cs.|rollingInterval: RollingInterval.Minute|RollingInterval.Day| |retainedFileCountLimit|The maximum number of log files that will be retained, including the current log file. For unlimited retention, pass null.|10|31| |encoding|Character encoding used to write the text file. Check: https://docs.microsoft.com/de-de/dotnet/api/system.text.encoding?view=netframework-4.8.|encoding: Encoding.Unicode|nullmeaningEncoding.UTF8| |hooks|Optionally enables hooking into log file lifecycle events. Check: https://github.com/serilog/serilog-sinks-file/blob/dev/src/Serilog.Sinks.File/Sinks/File/FileLifecycleHooks.cs and https://github.com/cocowalla/serilog-sinks-file-header/blob/master/src/Serilog.Sinks.File.Header/HeaderWriter.cs.|hooks: new HeaderWriter("Timestamp,Level,Message")|null`|

Full example

var levelSwitch = new LoggingLevelSwitch();
levelSwitch.MinimumLevel = LogEventLevel.Warning;

var logger = new LoggerConfiguration().WriteTo
    .AmazonS3(
        "log.txt",
        "mytestbucket-aws",
        Amazon.RegionEndpoint.EUWest2,
        "ABCDEFGHIJKLMNOP",
        "c3fghsrgwegfn://asdfsdfsdgfsdg",
        restrictedToMinimumLevel:LogEventLevel.Verbose,
        outputTemplate:"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
        new CultureInfo("de-DE"),
        fileSizeLimitBytes: 200,
        levelSwitch: levelSwitch,
        buffered: true,
        rollingInterval: RollingInterval.Minute,
        retainedFileCountLimit: 10,
        encoding: Encoding.Unicode,
        hooks: new HeaderWriter("Timestamp,Level,Message"))
    .CreateLogger();

    for (var x = 0; x < 200; x++)
    {
        var ex = new Exception("Test");
        logger.Error(ex.ToString());
    }

Further links

Change history

  • Version 1.0.0.0 (2019-05-31) : 1.0 release.

Serilog.Sinks.AmazonS3

Serilog.Sinks.AmazonS3 is a library to save logging information from Serilog to Amazon S3. The idea there was to upload log files to Amazon S3 to later evaluate them with Amazon EMR services. The assembly was written and tested in .Net Framework 4.8 and .Net Standard 2.0. This project makes use of the Serilog.Sinks.File's code in a major part, so thanks to all the contributors of this project 👍.

Build status GitHub issues GitHub forks GitHub stars GitHub license Nuget NuGet Downloads Known Vulnerabilities

Available for

  • NetFramework 4.5
  • NetFramework 4.6
  • NetFramework 4.6.2
  • NetFramework 4.7
  • NetFramework 4.7.2
  • NetFramework 4.8
  • NetStandard 2.0

Basic usage:

var logger = new LoggerConfiguration().WriteTo
    .AmazonS3(
        "log.txt",
        "mytestbucket-aws",
        Amazon.RegionEndpoint.EUWest2,
        "ABCDEFGHIJKLMNOP",
        "c3fghsrgwegfn://asdfsdfsdgfsdg",
        fileSizeLimitBytes: 200,
        rollingInterval: RollingInterval.Minute)
    .CreateLogger();

    for (var x = 0; x < 200; x++)
    {
        var ex = new Exception("Test");
        logger.Error(ex.ToString());
    }

The project can be found on nuget.

Configuration options:

|Parameter|Meaning|Example|Default value| |-|-|-|-| |path|The main log file name used.|"log.txt"|None, is mandatory.| |bucketName|The name of the Amazon S3 bucket to use. Check: https://docs.aws.amazon.com/general/latest/gr/rande.html.|`"mytestbucket-aws"`|None, is mandatory.| |endpoint|The Amazon S3 endpoint location.|RegionEndpoint.EUWest2|None, is mandatory.| |awsAccessKeyId|The Amazon S3 access key id.|ABCDEFGHIJKLMNOP|None, is mandatory.| |awsSecretAccessKey|The Amazon S3 secret access key.|c3fghsrgwegfn://asdfsdfsdgfsdg|None, is mandatory.| |restrictedToMinimumLevel|The minimum level for events passed through the sink. Ignored when levelSwitch is specified. Check: https://github.com/serilog/serilog/blob/dev/src/Serilog/Events/LogEventLevel.cs.|`LogEventLevel.Information`|`LogEventLevel.Verbose`| |outputTemplate|A message template describing the format used to write to the sink.|"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"|"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"| |formatProvider|The IFormatProvider to use. Supplies culture-specific formatting information. Check: https://docs.microsoft.com/en-us/dotnet/api/system.iformatprovider?view=netframework-4.8.|`new CultureInfo("de-DE")|null| |fileSizeLimitBytes|The number of bytes in a file. The sink rolls to a new file after the limit is reached.|200|1L * 1024 * 1024 * 1024| |levelSwitch|A switch allowing the pass-through minimum level to be changed at runtime. Check: https://nblumhardt.com/2014/10/dynamically-changing-the-serilog-level/.|var levelSwitch = new LoggingLevelSwitch(); levelSwitch.MinimumLevel = LogEventLevel.Warning;|null| |buffered|Indicates if flushing to the output file can be buffered or not.|buffered: true|false| |rollingInterval|The interval at which logging will roll over to a new file. Check: https://github.com/serilog/serilog-sinks-file/blob/dev/src/Serilog.Sinks.File/RollingInterval.cs.|rollingInterval: RollingInterval.Minute|RollingInterval.Day| |retainedFileCountLimit|The maximum number of log files that will be retained, including the current log file. For unlimited retention, pass null.|10|31| |encoding|Character encoding used to write the text file. Check: https://docs.microsoft.com/de-de/dotnet/api/system.text.encoding?view=netframework-4.8.|encoding: Encoding.Unicode|nullmeaningEncoding.UTF8| |hooks|Optionally enables hooking into log file lifecycle events. Check: https://github.com/serilog/serilog-sinks-file/blob/dev/src/Serilog.Sinks.File/Sinks/File/FileLifecycleHooks.cs and https://github.com/cocowalla/serilog-sinks-file-header/blob/master/src/Serilog.Sinks.File.Header/HeaderWriter.cs.|hooks: new HeaderWriter("Timestamp,Level,Message")|null`|

Full example

var levelSwitch = new LoggingLevelSwitch();
levelSwitch.MinimumLevel = LogEventLevel.Warning;

var logger = new LoggerConfiguration().WriteTo
    .AmazonS3(
        "log.txt",
        "mytestbucket-aws",
        Amazon.RegionEndpoint.EUWest2,
        "ABCDEFGHIJKLMNOP",
        "c3fghsrgwegfn://asdfsdfsdgfsdg",
        restrictedToMinimumLevel:LogEventLevel.Verbose,
        outputTemplate:"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
        new CultureInfo("de-DE"),
        fileSizeLimitBytes: 200,
        levelSwitch: levelSwitch,
        buffered: true,
        rollingInterval: RollingInterval.Minute,
        retainedFileCountLimit: 10,
        encoding: Encoding.Unicode,
        hooks: new HeaderWriter("Timestamp,Level,Message"))
    .CreateLogger();

    for (var x = 0; x < 200; x++)
    {
        var ex = new Exception("Test");
        logger.Error(ex.ToString());
    }

Further links

Change history

  • Version 1.0.0.0 (2019-05-31) : 1.0 release.

Release Notes

Version 1.0.0.0 (2019-05-31): 1.0 release.

Dependencies

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.8 57 7/25/2021
1.1.7 349 6/4/2021
1.1.6 186 5/15/2021
1.1.5 321 4/29/2021
1.1.4 251 4/7/2021
1.1.3 3,160 3/31/2021
1.1.2 1,389 2/27/2021
1.1.1 92 2/21/2021
1.1.0 160 2/3/2021
1.0.12 11,031 7/16/2020
1.0.11 175 7/15/2020
1.0.10 4,596 6/5/2020
1.0.9 19,623 5/10/2020
1.0.8 7,391 3/26/2020
1.0.7 359 2/9/2020
1.0.6 2,581 12/9/2019
1.0.5 233 12/8/2019
1.0.4 1,715 11/12/2019
1.0.3 255 11/8/2019
1.0.2 439 7/25/2019
1.0.1 354 6/23/2019
1.0.0 1,971 6/1/2019
Show less