Connatix.NLogKinesisTarget 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Connatix.NLogKinesisTarget --version 1.0.5
NuGet\Install-Package Connatix.NLogKinesisTarget -Version 1.0.5
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="Connatix.NLogKinesisTarget" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Connatix.NLogKinesisTarget --version 1.0.5
#r "nuget: Connatix.NLogKinesisTarget, 1.0.5"
#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 Connatix.NLogKinesisTarget as a Cake Addin
#addin nuget:?package=Connatix.NLogKinesisTarget&version=1.0.5

// Install Connatix.NLogKinesisTarget as a Cake Tool
#tool nuget:?package=Connatix.NLogKinesisTarget&version=1.0.5

Connatix.NLogKinesisTarget

Custom NLog target for streaming events to AWS Kinesis Stream in batches

Usage

  1. Add the library as a package reference to any .NET Core 2.0 App
  2. Add an NLog.config to your project
  3. Configure copy to output for the NLog.config
<ItemGroup>
    <None Include="NLog.config" CopyToOutputDirectory="Always">
    </None>
</ItemGroup>

Sample NLog.config

<?xml version="1.0" encoding="utf-8" ?>
<nlog 
  xmlns="http://www.nlog-project.org/schemas/NLog.xsd" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="true" internalLogLevel="Off" internalLogFile="nlog-internal.log">
  
  <extensions>
    <add assembly="NLog.Web.AspNetCore"/>
    <add assembly="Connatix.NLogKinesisTarget"/>
  </extensions>
  <targets>
    <target xsi:type="ConnatixKinesisTarget" name ="kinesis" BatchSize="<BATCH_SIZE>" MaxSize="<MAX_SIZE>" BatchInterval="<BATCH_INTERVAL>" AwsKey="<AWS_KEY>" AwsSecret="<AWS_SECRET>" AwsRegion="<AWS_REGION>" Stream="<STREAM_NAME>">
      <layout type='JsonLayout' includeAllProperties="true">
        <attribute name="machineName" layout="${machinename}" />
        <attribute name="siteName" layout="${iis-site-name}" />
        <attribute name="processname" layout="${processname}" />
        <attribute name="@timestamp" layout="${date:universalTime=True:format=yyyy-MM-ddTHH\:mm\:ssZ}" />
        <attribute name="level" layout="${level}" />
        <attribute name="username" layout="${aspnet-user-identity}" />
        <attribute name="message" layout="${message}" />
        <attribute name="logger" layout="${logger}" />
        <attribute name="url" layout="${aspnet-request-url:IncludeHost=True:IncludePort=True:IncludeQueryString=True}" />
        <attribute name="referrer" layout="${aspnet-request-referrer}" />
        <attribute name="ip" layout="${aspnet-request:header=X-Forwarded-For}" />
        <attribute name="ua" layout="${aspnet-request:header=User-Agent}" />
        <attribute name="exception" layout="${exception:format=ToString:maxInnerExceptionLevel=2}" />
      </layout>
    </target>
  </targets>
  <rules>
    <logger name="*" minlevel="Warn" writeTo="kinesis" />
  </rules>
</nlog>

Configurable Fields

AWS_KEY: AWS key with write permissions on the Kinesis Stream.

AWS_SECRET: Secret for the provided AWS_KEY.

AWS_REGION: AWS Region (https://docs.aws.amazon.com/general/latest/gr/rande.html) e.g. us-east-1.

STREAM_NAME: AWS Kinesis stream name to write events to.

BATCH_SIZE: Maximum number of events to be sent in 1 batch to AWS Kinesis Stream.

MAX_SIZE: The maximum queue size of events. In case the limit is reached, new events are not being queued for sending to AWS Kinesis Stream.

BATCH_INTERVAL: Interval in milliseconds between sending events to AWS Kinesis.

IAM: If AWS_KEY or AWS_SECRET is not passed then the authentication to AWS will be performed using instance IAM

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
3.0.8082.2 5,206 12/1/2020
3.0.8006.6 1,836 11/27/2020
3.0.1028.43 413 2/20/2021
3.0.1028.42 379 2/20/2021
2.0.53716 2,272 9/9/2020
2.0.53694 454 9/9/2020
2.0.53688 439 9/9/2020
2.0.51327 1,238 9/3/2020
2.0.50484 5,797 9/1/2020
2.0.50483 472 9/1/2020
1.0.7 28,731 8/25/2019
1.0.6 29,358 2/19/2019
1.0.5 10,250 8/29/2018
1.0.4 863 8/29/2018
1.0.3 800 8/29/2018
1.0.2 829 8/28/2018
1.0.1 1,225 2/13/2018
1.0.0 977 2/13/2018