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
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
16
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
17
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
20
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
21
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
22
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
23
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
24
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
25
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
28
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
30
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
31
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
32
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
67

.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 33 07/19/2024
3.0.1-dev-00816 19 07/19/2024
3.0.0 28 07/19/2024
3.0.0-dev-00811 19 07/19/2024
3.0.0-dev-00806 24 07/19/2024
3.0.0-dev-00804 17 07/19/2024
3.0.0-dev-00802 24 07/20/2024
2.3.1-dev-00801 27 07/19/2024
2.3.0 23 06/28/2024
2.3.0-dev-00793 23 07/19/2024
2.3.0-dev-00792 24 07/19/2024
2.3.0-dev-00791 27 07/19/2024
2.2.1-dev-00787 15 07/19/2024
2.2.0 38 02/05/2024
2.2.0-dev-00784 25 07/19/2024
2.2.0-dev-00780 15 07/19/2024
2.2.0-dev-00777 23 07/19/2024
2.2.0-dev-00773 22 07/19/2024
2.2.0-dev-00770 17 07/19/2024
2.2.0-dev-00761 22 07/19/2024
2.1.3 21 07/19/2024
2.1.3-dev-00759 33 07/19/2024
2.1.3-dev-00752 19 07/19/2024
2.1.3-dev-00748 25 07/19/2024
2.1.3-dev-00746 23 07/19/2024
2.1.3-dev-00736 22 07/19/2024
2.1.2 24 07/19/2024
2.1.2-dev-00731 23 07/19/2024
2.1.1 28 07/19/2024
2.1.1-dev-00727 25 07/19/2024
2.1.1-dev-00724 25 07/19/2024
2.1.0 22 07/19/2024
2.1.0-dev-00719 27 07/19/2024
2.0.1 27 07/19/2024
2.0.0 20 07/19/2024
2.0.0-rc-710 25 07/19/2024
2.0.0-rc-708 17 07/19/2024
2.0.0-beta-701 26 07/19/2024
2.0.0-beta-700 16 07/19/2024
2.0.0-beta-521 16 07/19/2024
2.0.0-beta-519 18 07/19/2024
2.0.0-beta-516 16 07/19/2024
2.0.0-beta-515 20 07/19/2024
2.0.0-beta-513 14 07/19/2024
2.0.0-beta-511 19 07/19/2024
2.0.0-beta-509 22 07/19/2024
2.0.0-beta-507 26 07/19/2024
2.0.0-beta-505 21 07/19/2024
2.0.0-beta-502 26 07/19/2024
2.0.0-beta-499 17 07/19/2024