NLog.Targets.Http 0.0.1-PreRelease

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

// Install NLog.Targets.Http as a Cake Tool
#tool nuget:?package=NLog.Targets.Http&version=0.0.1-PreRelease&prerelease

NLog.Targets.HTTP

NLog.Targets.HTTP is a HTTP POST target for NLog. Combined with JSON formatter it can be used to send events to an instance of Splunk and other HTTP based collectors.

Getting started

Available Configuration Parameters

Listed below are available configuration parameters with their default values

<target name='target name' 
        type='HTTP' 
        URL='protocol://server:port/path'
        Method='POST'
        Authorization='phrase token' 
        BatchSize='0'
        MaxQueueSize='2147483647'
        IgnoreSslErrors='true'
        FlushBeforeShutdown='true'
        ContentType='application/json'
        Accept='application/json'
        DefaultConnectionLimit='10'
        Expect100Continue='false'
        ConnectTimeout='30000' 
        InMemoryCompression='true'
    >

URL

The URL to send messages to (mandatory)

Method

HTTP method to use (GET,POST,PUT, etc.)

Authorization

The Authorization Header value to pass.

BatchSize

Number of messages to be sent together in ne call separated by an empty new line

MaxQueueSize

Maximum number of messages awaiting to be send. Please note, that if this vakue is set, the logger will be blocking.

IgnoreSsslErrors

Some SSL certificates might be invalid or not-trusted

FlushBeforeShutdown

Force all messages to be delivered before shutting down.

ContentType

HTTP ContentType Header value.

Accept

HTTP Accept Header value.

DefaultConnectionLimit

How many connections might be used at the same time. Changes ServicePointManager.DefaultConnectionLimit if value is less than specified.

Expect100Continue

See this article

ConnectTimeout

How long should the client wait to connect (default is 30 seconds).

InMemoryCompression

Reduces the amount of memory consumed at the expense of increased CPU usage.

Sample SPLUNK Configuration

<?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" >
  <targets>
    <target name='splunk' 
            type='HTTP' URL='server:port/services/collector'
            Authorization='Splunk auth-token' 
            BatchSize='100'>
      <layout type='JsonLayout'>
        <attribute name='sourcetype' layout='_json' />
        <attribute name='host' layout='myHostName' />
        <attribute name='event' encode='false'>
          <layout type='JsonLayout'>
            <attribute name='level' layout='${level:upperCase=true}' />
            <attribute name='source' layout='${logger}' />
            <attribute name='thread' layout='${threadid}' />
            <attribute name='message' layout='${message}' />
            <attribute name='utc' layout='${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss.fff}' />
          </layout>
        </attribute>
      </layout>
    </target>
  </targets> <rules>
    <logger name="*" minlevel="Debug" writeTo="splunk" />
  </rules>
</nlog>
Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

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
1.0.20 149,869 1/2/2022
1.0.19 272 1/2/2022
1.0.18 632 1/2/2022
1.0.17 284 1/2/2022
1.0.16 8,251 10/30/2021
1.0.10 2,112 10/5/2021
1.0.9 324 10/5/2021
1.0.8 1,335 9/20/2021
1.0.7 9,815 4/14/2021
1.0.6 352 4/14/2021
1.0.5 411 4/9/2021
1.0.4 3,957 2/11/2021
1.0.3 346 2/10/2021
1.0.2 5,989 9/18/2020
1.0.1 54,369 11/6/2019
1.0.0 958 10/3/2019
0.0.8 525 10/1/2019
0.0.7 469 9/30/2019
0.0.6 458 9/30/2019
0.0.5 471 9/26/2019
0.0.4 488 9/11/2019
0.0.3 499 8/30/2019
0.0.2 521 8/30/2019
0.0.1-PreRelease 396 8/30/2019