Serilog.Sinks.AmazonS3.Uploader 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Serilog.Sinks.AmazonS3.Uploader --version 1.0.0
NuGet\Install-Package Serilog.Sinks.AmazonS3.Uploader -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog.Sinks.AmazonS3.Uploader" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Serilog.Sinks.AmazonS3.Uploader --version 1.0.0
#r "nuget: Serilog.Sinks.AmazonS3.Uploader, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Serilog.Sinks.AmazonS3.Uploader as a Cake Addin
#addin nuget:?package=Serilog.Sinks.AmazonS3.Uploader&version=1.0.0

// Install Serilog.Sinks.AmazonS3.Uploader as a Cake Tool
#tool nuget:?package=Serilog.Sinks.AmazonS3.Uploader&version=1.0.0

A Serilog sink sending log files to Amazon S3

Serilog.Sinks.AmazonS3.Uploader

NuGet Version NuGet Documentation Join the chat at https://gitter.im/serilog/serilog Help

Package - Serilog.Sinks.AmazonS3.Uploader | Platforms - NET 5.0

Installation

If you want to include the sink in your project, you can install it directly from NuGet.

To install the sink, run the following command in the Package Manager Console:

PM> Install-Package Serilog.Sinks.AmazonS3.Uploader

Use cases

This sink should be used when you already have a process which is producing your log files and you want to upload these files to S3 for archiving. Once file is uploaded - it is deleted from original location.

NOTE: this process heavily depends on file locking. Normally serilog keeps current file locked and prevents access to it. So file cannot be uploaded while file is locked. However when file is rolled over (by time or size limitations) it is unlocked. Then this sink is able to upload the file to S3.

Usage

In the following example the sink will read files in specified directory (c:/temp/logs) and sends them to S3 bucket (application-logs). Please note that it should exists another logger which produces log files and AmazonS3.Uploader does not write any local files nor it collects log events.

Used in conjunction with Serilog.Settings.Configuration the same sink can be configured in the following way:

{
    "Serilog": {
        "MinimumLevel": {"Default": "Debug"},
        "WriteTo": [
            {
                "Name": "File",
                "Args": {
                    "path": "c:/temp/logs/application.log",
                    "rollingInterval": "Day",
                    "fileSizeLimitBytes": "104857600",
                    "rollOnFileSizeLimit": true
                }
            },
            {
                "Name": "S3",
                "Args": {
                    "logFileFolder": "c:/temp/logs",
                    "bucketName": "application-logs",
                    "accessKey": "",
                    "secretKey": "",
                    "region": "eu-west-1",
                    "s3Path": "dev/%timestamp%/application",
                    "filePrefix": "machine-name",
                    "period": "01:00:00"
                }
            }
        ]
    },
}

Parameters

  • logFileFolder > folder to watch for available files
  • bucketName > S3 bucket name where to upload files
  • accessKey > Amazon access key
  • secretKey > Amazon secret key
  • region > S3 bucket region
  • s3Path > folder inside S3 where to put uploaded files
    • %timestamp% - formats file last write time as yyyyMM
  • filePrefix > adds a prefix to a file, usefull when multiple instances of the same service are running, in that case prefix should be uniquely identifying instance
  • period > defines how often to check for available files
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 5,891 7/28/2022
1.1.0 1,023 10/14/2021
1.0.0 346 9/25/2021