Serilog.Enrichers.Environment 3.0.1-dev-00816

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
104
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
105
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
106
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
107
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
111
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
113
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
114
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
121
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
124
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
125
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
126
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
127
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
130
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
132
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
133
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
223

.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 135 07/19/2024
3.0.1-dev-00816 110 07/19/2024
3.0.0 125 07/19/2024
3.0.0-dev-00811 113 07/19/2024
3.0.0-dev-00806 124 07/19/2024
3.0.0-dev-00804 104 07/19/2024
3.0.0-dev-00802 114 07/20/2024
2.3.1-dev-00801 113 07/19/2024
2.3.0 109 06/28/2024
2.3.0-dev-00793 103 07/19/2024
2.3.0-dev-00792 140 07/19/2024
2.3.0-dev-00791 115 07/19/2024
2.2.1-dev-00787 100 07/19/2024
2.2.0 125 02/05/2024
2.2.0-dev-00784 108 07/19/2024
2.2.0-dev-00780 111 07/19/2024
2.2.0-dev-00777 113 07/19/2024
2.2.0-dev-00773 126 07/19/2024
2.2.0-dev-00770 107 07/19/2024
2.2.0-dev-00761 123 07/19/2024
2.1.3 105 07/19/2024
2.1.3-dev-00759 120 07/19/2024
2.1.3-dev-00752 115 07/19/2024
2.1.3-dev-00748 118 07/19/2024
2.1.3-dev-00746 117 07/19/2024
2.1.3-dev-00736 102 07/19/2024
2.1.2 104 07/19/2024
2.1.2-dev-00731 116 07/19/2024
2.1.1 124 07/19/2024
2.1.1-dev-00727 134 07/19/2024
2.1.1-dev-00724 117 07/19/2024
2.1.0 135 07/19/2024
2.1.0-dev-00719 116 07/19/2024
2.0.1 131 07/19/2024
2.0.0 108 07/19/2024
2.0.0-rc-710 124 07/19/2024
2.0.0-rc-708 115 07/19/2024
2.0.0-beta-701 113 07/19/2024
2.0.0-beta-700 118 07/19/2024
2.0.0-beta-521 107 07/19/2024
2.0.0-beta-519 103 07/19/2024
2.0.0-beta-516 114 07/19/2024
2.0.0-beta-515 103 07/19/2024
2.0.0-beta-513 102 07/19/2024
2.0.0-beta-511 109 07/19/2024
2.0.0-beta-509 114 07/19/2024
2.0.0-beta-507 120 07/19/2024
2.0.0-beta-505 123 07/19/2024
2.0.0-beta-502 129 07/19/2024
2.0.0-beta-499 109 07/19/2024