Elastic.Apm.SerilogEnricher 1.4.0-beta1

Enrich your logs with APM TraceId and TransactionId automatically

This is a prerelease version of Elastic.Apm.SerilogEnricher.
There is a newer version of this package available.
See the version list below for details.
Install-Package Elastic.Apm.SerilogEnricher -Version 1.4.0-beta1
dotnet add package Elastic.Apm.SerilogEnricher --version 1.4.0-beta1
<PackageReference Include="Elastic.Apm.SerilogEnricher" Version="1.4.0-beta1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Elastic.Apm.SerilogEnricher --version 1.4.0-beta1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Elastic.Apm.SerilogEnricher, 1.4.0-beta1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Elastic.Apm.SerilogEnricher as a Cake Addin
#addin nuget:?package=Elastic.Apm.SerilogEnricher&version=1.4.0-beta1&prerelease

// Install Elastic.Apm.SerilogEnricher as a Cake Tool
#tool nuget:?package=Elastic.Apm.SerilogEnricher&version=1.4.0-beta1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Elastic APM Serilog Enricher

This enricher adds the transaction id and trace id to every Serilog log message that is created during a transaction.

How to Enable

var logger = new LoggerConfiguration()
   .Enrich.WithElasticApmCorrelationInfo()
   .WriteTo.Console(outputTemplate: "[{ElasticApmTraceId} {ElasticApmTransactionId} {Message:lj} {NewLine}{Exception}")
   .CreateLogger();

In the code snippet above Enrich.WithElasticApmCorrelationInfo() enables the enricher from this project, which will set 2 properties for log lines that are created during a transaction:

  • ElasticApmTransactionId
  • ElasticApmTraceId

In the outputTemplate of the Console sink these two properties are printed, of course they can be used with any sink.

Prerequisite

The prerequisite for this to work is a configured Elastic APM Agent. If the agent is not configured the enricher won't add anything to the logs.

Copyright and License

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

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

Elastic APM Serilog Enricher

This enricher adds the transaction id and trace id to every Serilog log message that is created during a transaction.

How to Enable

var logger = new LoggerConfiguration()
   .Enrich.WithElasticApmCorrelationInfo()
   .WriteTo.Console(outputTemplate: "[{ElasticApmTraceId} {ElasticApmTransactionId} {Message:lj} {NewLine}{Exception}")
   .CreateLogger();

In the code snippet above Enrich.WithElasticApmCorrelationInfo() enables the enricher from this project, which will set 2 properties for log lines that are created during a transaction:

  • ElasticApmTransactionId
  • ElasticApmTraceId

In the outputTemplate of the Console sink these two properties are printed, of course they can be used with any sink.

Prerequisite

The prerequisite for this to work is a configured Elastic APM Agent. If the agent is not configured the enricher won't add anything to the logs.

Copyright and License

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

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

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Elastic.Apm.SerilogEnricher:

Package Downloads
DDPlanet.Logging
Simple logging framework developed for ELK stack based on Serilog providing fully configured logging in just a couple lines of code
BioEngine.Extra.ElasticStack
Package Description
Sitko.Core.ElasticStack
Sitko.Core is a set of libraries to help build .NET Core applications fast
Apprio.Enablement.Telemetry
Package Description
Infra.Net.LogManager.WebExtensions
Extensões de LogManager para utilização com sistemas Web

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Elastic.Apm.SerilogEnricher:

Repository Stars
aspose-cells/Aspose.Cells-for-.NET
Aspose.Cells for .NET examples, plugins and showcases
gizemcifguvercin/E-News
This project is about how we can send news to related news agency. You can look at Use Case, Architecture, Technical Overview on README file

Version History

Version Downloads Last updated
1.6.0-alpha1 62 6/2/2021
1.5.3 6,934 6/1/2021
1.5.1 457,538 6/3/2020
1.5.0 62,548 3/30/2020
1.4.4 1,167 3/25/2020
1.4.3 113,710 3/16/2020
1.4.2 4,734 3/6/2020
1.4.1 1,924 2/26/2020
1.4.0 8,580 1/29/2020
1.4.0-beta1 376 1/7/2020
Show less