NLog.Targets.Http
0.0.2
See the version list below for details.
dotnet add package NLog.Targets.Http --version 0.0.2
NuGet\Install-Package NLog.Targets.Http -Version 0.0.2
<PackageReference Include="NLog.Targets.Http" Version="0.0.2" />
paket add NLog.Targets.Http --version 0.0.2
#r "nuget: NLog.Targets.Http, 0.0.2"
// Install NLog.Targets.Http as a Cake Addin #addin nuget:?package=NLog.Targets.Http&version=0.0.2 // Install NLog.Targets.Http as a Cake Tool #tool nuget:?package=NLog.Targets.Http&version=0.0.2
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 | Versions 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 | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. 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. |
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 | 260,586 | 1/2/2022 | |
1.0.19 | 303 | 1/2/2022 | |
1.0.18 | 842 | 1/2/2022 | |
1.0.17 | 315 | 1/2/2022 | |
1.0.16 | 8,316 | 10/30/2021 | |
1.0.10 | 2,236 | 10/5/2021 | |
1.0.9 | 347 | 10/5/2021 | |
1.0.8 | 1,360 | 9/20/2021 | |
1.0.7 | 10,755 | 4/14/2021 | |
1.0.6 | 390 | 4/14/2021 | |
1.0.5 | 442 | 4/9/2021 | |
1.0.4 | 4,427 | 2/11/2021 | |
1.0.3 | 384 | 2/10/2021 | |
1.0.2 | 6,625 | 9/18/2020 | |
1.0.1 | 56,340 | 11/6/2019 | |
1.0.0 | 1,018 | 10/3/2019 | |
0.0.8 | 558 | 10/1/2019 | |
0.0.7 | 499 | 9/30/2019 | |
0.0.6 | 500 | 9/30/2019 | |
0.0.5 | 510 | 9/26/2019 | |
0.0.4 | 518 | 9/11/2019 | |
0.0.3 | 533 | 8/30/2019 | |
0.0.2 | 554 | 8/30/2019 | |
0.0.1-PreRelease | 430 | 8/30/2019 |
Version 0.0.2
- Thanks to Alan Barber (https://github.com/AlanBarber) for NuGet build scripts and inspiration for this Http Target (his Splunk target https://github.com/AlanBarber/NLog.Targets.Splunk).
- Thanks to Nate McMaster (https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/) and Derek Comartin (https://codeopinion.com/converting-a-library-to-netstandard/) for conversion tips
Version 0.0.1
- Big thanks to Stan Smith for insiting to make it lean and performant
- First publish to NuGet