Serilog.Enrichers.Environment 3.0.1

Serilog.Enrichers.Environment

Enriches Serilog events with information from the execution environment.

Build status NuGet Version

To use the enricher, first install the NuGet package:

dotnet add package Serilog.Enrichers.Environment

Then, apply the enricher to you LoggerConfiguration:

Log.Logger = new LoggerConfiguration()
    .Enrich.WithMachineName()
    // ...other configuration...
    .CreateLogger();

The WithMachineName() enricher will add a MachineName property to produced events.

Included enrichers

The package includes:

  • WithMachineName() - adds MachineName based on either %COMPUTERNAME% (Windows) or $HOSTNAME (macOS, Linux)
  • WithEnvironmentUserName() - adds EnvironmentUserName based on USERNAME and USERDOMAIN (if available)
  • WithEnvironmentName() - adds EnvironmentName based on ASPNETCORE_ENVIRONMENT or DOTNET_ENVIRONMENT (when both are available then 'ASPNETCORE_ENVIRONMENT' takes precedence, when none are available then the fallback value will be 'Production')
  • WithEnvironmentVariable(string envVarName, string propertyName = null) - adds an <envVarName> property to the log event with the value for the specified environment variable. Optional <propertyName> will override <envVarName> as propertyName.

Copyright © 2016 Serilog Contributors - Provided under the Apache License, Version 2.0.

Showing the top 20 packages that depend on Serilog.Enrichers.Environment.

Packages Downloads
NBomber
Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
16
NBomber
Very simple load testing framework for Pull and Push scenarios.
15
NBomber
Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
15
NBomber
Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
14
NBomber
Very simple load testing framework for Pull and Push scenarios.
14

.NET Framework 4.6.2

.NET Framework 4.7.1

.NET 6.0

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
3.0.1 14 10/10/2024
3.0.1-dev-00816 14 10/10/2024
3.0.0 12 10/10/2024
3.0.0-dev-00811 12 10/10/2024
3.0.0-dev-00806 12 10/10/2024
3.0.0-dev-00804 14 10/10/2024
3.0.0-dev-00802 14 10/10/2024
2.3.1-dev-00801 12 10/10/2024
2.3.0 10 10/10/2024
2.3.0-dev-00793 12 10/10/2024
2.3.0-dev-00792 8 10/10/2024
2.3.0-dev-00791 9 10/10/2024
2.2.1-dev-00787 12 10/10/2024
2.2.0 15 02/04/2022
2.2.0-dev-00784 9 10/10/2024
2.2.0-dev-00780 11 10/10/2024
2.2.0-dev-00777 13 10/10/2024
2.2.0-dev-00773 13 10/10/2024
2.2.0-dev-00770 12 10/10/2024
2.2.0-dev-00761 13 10/10/2024
2.1.3 10 10/10/2024
2.1.3-dev-00759 8 10/10/2024
2.1.3-dev-00752 8 10/10/2024
2.1.3-dev-00748 15 10/10/2024
2.1.3-dev-00746 11 10/10/2024
2.1.3-dev-00736 10 10/10/2024
2.1.2 12 10/10/2024
2.1.2-dev-00731 8 10/10/2024
2.1.1 12 10/10/2024
2.1.1-dev-00727 12 10/10/2024
2.1.1-dev-00724 13 10/10/2024
2.1.0 15 10/10/2024
2.1.0-dev-00719 11 10/10/2024
2.0.1 10 10/10/2024
2.0.0 11 10/10/2024
2.0.0-rc-710 14 10/10/2024
2.0.0-rc-708 14 10/10/2024
2.0.0-beta-701 13 10/10/2024
2.0.0-beta-700 13 10/10/2024
2.0.0-beta-521 13 10/10/2024
2.0.0-beta-519 13 10/10/2024
2.0.0-beta-516 13 10/10/2024
2.0.0-beta-515 14 10/10/2024
2.0.0-beta-513 13 10/10/2024
2.0.0-beta-511 14 10/10/2024
2.0.0-beta-509 14 10/10/2024
2.0.0-beta-507 17 10/10/2024
2.0.0-beta-505 13 10/10/2024
2.0.0-beta-502 14 10/10/2024
2.0.0-beta-499 11 10/10/2024