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
Alpata.Helper
Crypt işlemleri revize edildi.
6
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
2
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
3
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
4
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
5
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
6
Alpata.Helper
Option yönetimi için generik eklentiler sağlandı
9

.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 1 10/29/2024
3.0.1-dev-00816 0 06/20/2024
3.0.0 0 06/09/2024
3.0.0-dev-00811 0 06/09/2024
3.0.0-dev-00806 3 12/06/2023
3.0.0-dev-00804 2 03/13/2024
3.0.0-dev-00802 2 03/12/2024
2.3.1-dev-00801 2 03/04/2024
2.3.0 4 12/13/2023
2.3.0-dev-00793 3 03/16/2024
2.3.0-dev-00792 2 03/16/2024
2.3.0-dev-00791 2 03/14/2024
2.2.1-dev-00787 2 03/14/2024
2.2.0 5 08/18/2023
2.2.0-dev-00784 2 03/14/2024
2.2.0-dev-00780 2 03/02/2024
2.2.0-dev-00777 2 03/13/2024
2.2.0-dev-00773 2 03/12/2024
2.2.0-dev-00770 2 03/13/2024
2.2.0-dev-00761 0 08/02/2020
2.1.3 3 08/18/2023
2.1.3-dev-00759 2 03/22/2024
2.1.3-dev-00752 2 03/14/2024
2.1.3-dev-00748 2 03/13/2024
2.1.3-dev-00746 2 03/13/2024
2.1.3-dev-00736 2 03/13/2024
2.1.2 3 01/03/2024
2.1.2-dev-00731 2 03/13/2024
2.1.1 3 01/18/2024
2.1.1-dev-00727 2 03/13/2024
2.1.1-dev-00724 3 03/13/2024
2.1.0 3 12/13/2023
2.1.0-dev-00719 2 03/13/2024
2.0.1 3 12/11/2023
2.0.0 3 12/16/2023
2.0.0-rc-710 2 01/25/2024
2.0.0-rc-708 2 03/13/2024
2.0.0-beta-701 2 03/14/2024
2.0.0-beta-700 2 03/12/2024
2.0.0-beta-521 2 03/14/2024
2.0.0-beta-519 2 03/13/2024
2.0.0-beta-516 2 03/14/2024
2.0.0-beta-515 2 03/13/2024
2.0.0-beta-513 2 03/14/2024
2.0.0-beta-511 2 03/02/2024
2.0.0-beta-509 2 03/14/2024
2.0.0-beta-507 2 03/13/2024
2.0.0-beta-505 2 03/13/2024
2.0.0-beta-502 2 03/13/2024
2.0.0-beta-499 2 03/13/2024