Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

Enrich Serilog log events with properties from System.Environment.

License

Notifications You must be signed in to change notification settings

squaredup/serilog-enrichers-environment

 
 

Repository files navigation

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.

About

Enrich Serilog log events with properties from System.Environment.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 94.3%
  • PowerShell 4.7%
  • Shell 1.0%