Skip to content
Enrich Serilog log events with properties from System.Environment.
C# PowerShell Shell
Branch: dev
Clone or download
nblumhardt Merge pull request #36 from mbp/add-netstandard20-target
Add netstandard2.0 target to simplify dependency chain.
Latest commit fa90adf Aug 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Moved sink from core to new repo Mar 14, 2016
src/Serilog.Enrichers.Environment Add netstandard2.0 target to simplify dependency chain. Aug 28, 2019
test/Serilog.Enrichers.Environment.Tests
.editorconfig Moved sink from core to new repo Mar 14, 2016
.gitattributes Moved sink from core to new repo Mar 14, 2016
.gitignore Initial commit Mar 9, 2016
Build.ps1 New build scripts [Skip CI] Jul 18, 2016
CHANGES.md
LICENSE
README.md README improvement [Skip CI] Jul 26, 2016
appveyor.yml New NuGet API Key May 9, 2018
build.sh Updated key for GitHub releases for AppVeyor. Jun 28, 2016
serilog-enrichers-environment.sln migrate to csproj Aug 15, 2017

README.md

Serilog.Enrichers.Environment

Enriches Serilog events with information from the process environment.

Build status NuGet Version

To use the enricher, first install the NuGet package:

Install-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)

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

You can’t perform that action at this time.