SocketLabs.NLog.Targets.OpenSearch 2.0.12

dotnet add package SocketLabs.NLog.Targets.OpenSearch --version 2.0.12                
NuGet\Install-Package SocketLabs.NLog.Targets.OpenSearch -Version 2.0.12                
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="SocketLabs.NLog.Targets.OpenSearch" Version="2.0.12" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SocketLabs.NLog.Targets.OpenSearch --version 2.0.12                
#r "nuget: SocketLabs.NLog.Targets.OpenSearch, 2.0.12"                
#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 SocketLabs.NLog.Targets.OpenSearch as a Cake Addin
#addin nuget:?package=SocketLabs.NLog.Targets.OpenSearch&version=2.0.12

// Install SocketLabs.NLog.Targets.OpenSearch as a Cake Tool
#tool nuget:?package=SocketLabs.NLog.Targets.OpenSearch&version=2.0.12                

<img src="https://static.socketlabs.com/logos/logo-dark-sans-tag-507x64.png" alt="SocketLabs Logo" width="190" height="24" />

Build status

SocketLabs.NLog.Targets.OpenSearch

NLog Target for OpenSearch

This NLog target is designed to specifically work with OpenSearch Versions >=1.0. It is focused on performance, and doesn't require any third party clients.

Getting Started

Install the Nuget package

dotnet cli:

dotnet add package SocketLabs.NLog.Targets.OpenSearch

Visual Studio

Install-Package SocketLabs.NLog.Targets.OpenSearch

Add NLog.config to your project

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
            autoReload="true"
            throwExceptions="false"
            internalLogLevel="Warn" internalLogFile="logs/nlog-internal.log">

    <extensions>
        <add assembly="SocketLabs.NLog.Targets.OpenSearch"/>
    </extensions>

    <targets>
        <target xsi:type="OpenSearch"
                name="opensearch"
                uris="http://localhost:9200"
                username="logstash"
                password="Pa$$w0rd!"
                includeEventProperties="true"
                includeCallSite="true"
                includeCallSiteStackTrace="true"
                includeScopeProperties="true"
                enableHttpCompression="false"
                validateCertificates="false">

            <contextproperty name="appDomain" layout="${appdomain:format={1\}}" />
            <contextproperty name="assemblyVersion" layout="${assembly-version}" />
            <contextproperty name="dotnet.version" layout="${environment:DOTNET_VERSION}" />
            <contextproperty name="gc.collectionCount0" layout="${gc:property=CollectionCount0}" />
            <contextproperty name="gc.collectionCount1" layout="${gc:property=CollectionCount1}" />
            <contextproperty name="gc.collectionCount2" layout="${gc:property=CollectionCount2}" />
            <contextproperty name="gc.maxGeneration" layout="${gc:property=MaxGeneration}" />
            <contextproperty name="gc.totalMemory" layout="${gc:property=TotalMemory}" />
            <contextproperty name="gc.totalMemoryForceCollection" layout="${gc:property=TotalMemoryForceCollection}" />
            <contextproperty name="hostname" layout="${hostname}" />
            <contextproperty name="process.handleCount" layout="${processinfo:property=HandleCount}" />
            <contextproperty name="process.maxWorkingSet" layout="${processinfo:property=MaxWorkingSet}" />
            <contextproperty name="process.minWorkingSet" layout="${processinfo:property=MinWorkingSet}" />
            <contextproperty name="process.name" layout="${processname}" />
            <contextproperty name="process.peakWorkingSet64" layout="${processinfo:property=PeakWorkingSet64}" />
            <contextproperty name="process.pid" layout="${processinfo:property=Id}" />
            <contextproperty name="process.privateMemorySize64" layout="${processinfo:property=PrivateMemorySize64}" />
            <contextproperty name="process.startTime" layout="${processinfo:property=StartTime}" />
            <contextproperty name="process.virtualMemorySize64" layout="${processinfo:property=VirtualMemorySize64}" />
            <contextproperty name="process.workingSet64" layout="${processinfo:property=WorkingSet64}" />
            <contextproperty name="threadId" layout="${threadid}" />
            <contextproperty name="system.environment" layout="${systemEnvironment}" />
            <contextproperty name="kubernetes.namespace" layout="${environment:KUBERNETES_NAMESPACE}" />
        </target>
    </targets>

    <rules>
        <logger name="*" minlevel="Info" writeTo="opensearch" />
    </rules>
</nlog>

Building

Prerequisites

  • Visual Studio or VSCode
  • .NET 7

Release History

  • 1.0.0 Initial Release

License

This code base is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 is compatible.  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 net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in 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
2.0.12 112 10/29/2024