Connatix.NLogKinesisTarget
1.0.4
See the version list below for details.
dotnet add package Connatix.NLogKinesisTarget --version 1.0.4
NuGet\Install-Package Connatix.NLogKinesisTarget -Version 1.0.4
<PackageReference Include="Connatix.NLogKinesisTarget" Version="1.0.4" />
paket add Connatix.NLogKinesisTarget --version 1.0.4
#r "nuget: Connatix.NLogKinesisTarget, 1.0.4"
// Install Connatix.NLogKinesisTarget as a Cake Addin
#addin nuget:?package=Connatix.NLogKinesisTarget&version=1.0.4
// Install Connatix.NLogKinesisTarget as a Cake Tool
#tool nuget:?package=Connatix.NLogKinesisTarget&version=1.0.4
Connatix.NLogKinesisTarget
Custom NLog target for streaming events to AWS Kinesis Stream in batches
Usage
- Add the library as a package reference to any .NET Core 2.0 App
- Add an NLog.config to your project
- 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
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- AWSSDK.Core (>= 3.0.0)
- AWSSDK.Kinesis (>= 3.0.0)
- NLog (>= 4.0.0)
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 |