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.
No packages depend on Serilog.Enrichers.Environment.
Version | Downloads | Last updated |
---|---|---|
3.0.1 | 0 | 06/20/2024 |
3.0.1-dev-00816 | 0 | 06/20/2024 |
3.0.0 | 1 | 11/28/2024 |
3.0.0-dev-00811 | 0 | 06/09/2024 |
3.0.0-dev-00806 | 0 | 11/14/2023 |
3.0.0-dev-00804 | 0 | 10/26/2023 |
3.0.0-dev-00802 | 0 | 10/26/2023 |
2.3.1-dev-00801 | 0 | 10/16/2023 |
2.3.0 | 0 | 10/03/2023 |
2.3.0-dev-00793 | 0 | 06/04/2023 |
2.3.0-dev-00792 | 0 | 02/03/2023 |
2.3.0-dev-00791 | 0 | 01/04/2023 |
2.2.1-dev-00787 | 0 | 08/15/2021 |
2.2.0 | 0 | 08/15/2021 |
2.2.0-dev-00784 | 0 | 04/05/2021 |
2.2.0-dev-00780 | 0 | 02/10/2021 |
2.2.0-dev-00777 | 0 | 02/04/2021 |
2.2.0-dev-00773 | 0 | 12/15/2020 |
2.2.0-dev-00770 | 0 | 12/12/2020 |
2.2.0-dev-00761 | 0 | 08/02/2020 |
2.1.3 | 0 | 03/08/2019 |
2.1.3-dev-00759 | 0 | 06/29/2020 |
2.1.3-dev-00752 | 0 | 09/22/2018 |
2.1.3-dev-00748 | 0 | 06/03/2018 |
2.1.3-dev-00746 | 0 | 05/09/2018 |
2.1.3-dev-00736 | 0 | 08/16/2017 |
2.1.2 | 0 | 03/21/2017 |
2.1.2-dev-00731 | 0 | 02/21/2017 |
2.1.1 | 0 | 11/22/2016 |
2.1.1-dev-00727 | 0 | 11/22/2016 |
2.1.1-dev-00724 | 0 | 08/11/2016 |
2.1.0 | 0 | 07/26/2016 |
2.1.0-dev-00719 | 0 | 07/26/2016 |
2.0.1 | 0 | 07/18/2016 |
2.0.0 | 0 | 06/29/2016 |
2.0.0-rc-710 | 0 | 05/26/2016 |
2.0.0-rc-708 | 0 | 05/17/2016 |
2.0.0-beta-701 | 0 | 04/11/2016 |
2.0.0-beta-700 | 0 | 03/23/2016 |
2.0.0-beta-521 | 0 | 03/18/2016 |
2.0.0-beta-519 | 0 | 03/16/2016 |
2.0.0-beta-516 | 0 | 03/15/2016 |
2.0.0-beta-515 | 0 | 03/15/2016 |
2.0.0-beta-513 | 0 | 03/15/2016 |
2.0.0-beta-511 | 0 | 03/14/2016 |
2.0.0-beta-509 | 0 | 03/13/2016 |
2.0.0-beta-507 | 0 | 03/01/2016 |
2.0.0-beta-505 | 0 | 02/25/2016 |
2.0.0-beta-502 | 0 | 02/22/2016 |
2.0.0-beta-499 | 0 | 02/21/2016 |