Connatix.NLogKinesisTarget 1.0.2

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

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

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

There are no supported framework assets in this 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,204 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,356 2/19/2019
1.0.5 10,248 8/29/2018
1.0.4 861 8/29/2018
1.0.3 798 8/29/2018
1.0.2 827 8/28/2018
1.0.1 1,223 2/13/2018
1.0.0 975 2/13/2018