Serilog.Enrichers.Environment 3.0.0
Serilog.Enrichers.Environment
Enriches Serilog events with information from the execution environment.
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()
- addsMachineName
based on either%COMPUTERNAME%
(Windows) or$HOSTNAME
(macOS, Linux)WithEnvironmentUserName()
- addsEnvironmentUserName
based onUSERNAME
andUSERDOMAIN
(if available)WithEnvironmentName()
- addsEnvironmentName
based onASPNETCORE_ENVIRONMENT
orDOTNET_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
|
18 |
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
|
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
|
27 |
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
|
29 |
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
|
33 |
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
|
77 |
Version | Downloads | Last updated |
---|---|---|
3.0.1 | 35 | 07/19/2024 |
3.0.1-dev-00816 | 22 | 07/19/2024 |
3.0.0 | 31 | 07/19/2024 |
3.0.0-dev-00811 | 22 | 07/19/2024 |
3.0.0-dev-00806 | 28 | 07/19/2024 |
3.0.0-dev-00804 | 19 | 07/19/2024 |
3.0.0-dev-00802 | 28 | 07/20/2024 |
2.3.1-dev-00801 | 32 | 07/19/2024 |
2.3.0 | 24 | 06/28/2024 |
2.3.0-dev-00793 | 26 | 07/19/2024 |
2.3.0-dev-00792 | 28 | 07/19/2024 |
2.3.0-dev-00791 | 29 | 07/19/2024 |
2.2.1-dev-00787 | 18 | 07/19/2024 |
2.2.0 | 41 | 02/05/2024 |
2.2.0-dev-00784 | 29 | 07/19/2024 |
2.2.0-dev-00780 | 18 | 07/19/2024 |
2.2.0-dev-00777 | 26 | 07/19/2024 |
2.2.0-dev-00773 | 28 | 07/19/2024 |
2.2.0-dev-00770 | 20 | 07/19/2024 |
2.2.0-dev-00761 | 24 | 07/19/2024 |
2.1.3 | 22 | 07/19/2024 |
2.1.3-dev-00759 | 36 | 07/19/2024 |
2.1.3-dev-00752 | 24 | 07/19/2024 |
2.1.3-dev-00748 | 28 | 07/19/2024 |
2.1.3-dev-00746 | 26 | 07/19/2024 |
2.1.3-dev-00736 | 25 | 07/19/2024 |
2.1.2 | 26 | 07/19/2024 |
2.1.2-dev-00731 | 27 | 07/19/2024 |
2.1.1 | 30 | 07/19/2024 |
2.1.1-dev-00727 | 29 | 07/19/2024 |
2.1.1-dev-00724 | 27 | 07/19/2024 |
2.1.0 | 25 | 07/19/2024 |
2.1.0-dev-00719 | 30 | 07/19/2024 |
2.0.1 | 31 | 07/19/2024 |
2.0.0 | 21 | 07/19/2024 |
2.0.0-rc-710 | 29 | 07/19/2024 |
2.0.0-rc-708 | 19 | 07/19/2024 |
2.0.0-beta-701 | 28 | 07/19/2024 |
2.0.0-beta-700 | 18 | 07/19/2024 |
2.0.0-beta-521 | 18 | 07/19/2024 |
2.0.0-beta-519 | 21 | 07/19/2024 |
2.0.0-beta-516 | 18 | 07/19/2024 |
2.0.0-beta-515 | 22 | 07/19/2024 |
2.0.0-beta-513 | 16 | 07/19/2024 |
2.0.0-beta-511 | 23 | 07/19/2024 |
2.0.0-beta-509 | 24 | 07/19/2024 |
2.0.0-beta-507 | 30 | 07/19/2024 |
2.0.0-beta-505 | 22 | 07/19/2024 |
2.0.0-beta-502 | 27 | 07/19/2024 |
2.0.0-beta-499 | 19 | 07/19/2024 |