Elastic.Apm.NLog 8.6.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET Standard 2.0 .NET Framework 4.6.1
dotnet add package Elastic.Apm.NLog --version 8.6.1
NuGet\Install-Package Elastic.Apm.NLog -Version 8.6.1
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="Elastic.Apm.NLog" Version="8.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Elastic.Apm.NLog --version 8.6.1
#r "nuget: Elastic.Apm.NLog, 8.6.1"
#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 Elastic.Apm.NLog as a Cake Addin
#addin nuget:?package=Elastic.Apm.NLog&version=8.6.1

// Install Elastic.Apm.NLog as a Cake Tool
#tool nuget:?package=Elastic.Apm.NLog&version=8.6.1

Elastic APM NLog Layout Renderer

Allows you to add the following place holders in your NLog templates:

  • ElasticApmTraceId
  • ElasticApmTransactionId
  • ElasticApmSpanId
  • ElasticApmServiceName
  • ElasticApmServiceNodeName
  • ElasticApmServiceVersion

Which will be replaced with the appropriate Elastic APM variables if available


The .NET assemblies are published to NuGet under the package name Elastic.Apm.NLog

How to use from API

// Logged message will be in format of `trace-id|transation-id|span-id|InTransaction`
// or `|||InTransaction` if the place holders are not available
var consoleTarget = new ConsoleTarget("console");
consoleTarget.Layout = 
config.AddRule(LogLevel.Debug, LogLevel.Fatal, consoleTarget);
LogManager.Configuration = config;
var logger = LogManager.GetCurrentClassLogger();

How to use from NLog.config

    <add assembly="Elastic.Apm.NLog"/>
    <target name="console" 
        layout="${ElasticApmTraceId}|${ElasticApmTransactionId}|${ElasticApmSpanId}|${message}" />
    <logger name="*" minLevel="Debug" writeTo="Console" />


The prerequisite for this to work is a configured Elastic APM Agent. If the agent is not configured the APM place holders will be empty.

This software is Copyright (c) 2014-2020 by Elasticsearch BV.

This is free software, licensed under: The Apache License Version 2.0.

Product 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. 
.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 is compatible.  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)
Additional computed target framework(s)
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
8.6.1 4,236 8/3/2023
8.6.0 9,769 5/9/2023
8.4.0-alpha4 92 3/28/2023
8.4.0-alpha3 71 3/15/2023
8.4.0-alpha2 77 3/1/2023
8.4.0-alpha1 84 2/20/2023
1.6.0-alpha1 5,019 6/2/2021
1.5.3 482,973 6/1/2021
1.5.1 90,806 6/3/2020
1.5.0 2,648 3/30/2020
1.4.4 505 3/25/2020
1.4.3 926 3/16/2020
1.4.2 591 3/6/2020
1.4.1 574 2/26/2020
1.4.0 6,624 1/29/2020
1.4.0-beta1 549 1/7/2020