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.
<PackageVersion Include="NLog.Targets.Http" Version="0.0.1-PreRelease" />
                    
Directory.Packages.props
<PackageReference Include="NLog.Targets.Http" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version 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.
#addin nuget:?package=NLog.Targets.Http&version=0.0.1-PreRelease&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NLog.Targets.Http&version=0.0.1-PreRelease&prerelease
                    
Install as a Cake Tool

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 (1)

Showing the top 1 NuGet packages that depend on NLog.Targets.Http:

Package Downloads
Xente.Business.Suite.Infrastructure

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.20 373,533 1/2/2022
1.0.19 362 1/2/2022
1.0.18 1,067 1/2/2022
1.0.17 375 1/2/2022
1.0.16 10,499 10/30/2021
1.0.10 2,319 10/5/2021
1.0.9 403 10/5/2021
1.0.8 1,524 9/20/2021
1.0.7 12,865 4/14/2021
1.0.6 507 4/14/2021 1.0.6 is deprecated because it has critical bugs.
1.0.5 513 4/9/2021
1.0.4 4,632 2/11/2021
1.0.3 451 2/10/2021
1.0.2 6,946 9/18/2020
1.0.1 57,992 11/6/2019
1.0.0 1,153 10/3/2019
0.0.8 634 10/1/2019
0.0.7 573 9/30/2019
0.0.6 573 9/30/2019
0.0.5 588 9/26/2019
0.0.4 596 9/11/2019
0.0.3 615 8/30/2019
0.0.2 681 8/30/2019
0.0.1-PreRelease 500 8/30/2019