Skip to content

Commit

Permalink
Merge pull request #7 from serilog/dev
Browse files Browse the repository at this point in the history
2.1 Release
  • Loading branch information
nblumhardt authored Jul 26, 2016
2 parents 796239d + 97542a0 commit 2aa420a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.0.0
- Moved to new project
- DotNet Core support
2.1.0

* #4 - use `$HOSTNAME` to derive machine name on OSX/Linux

2.0.0

* Moved to new project
* DotNet Core support
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
#if ENV_USER_NAME
_cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.MachineName);
#else
_cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.GetEnvironmentVariable("COMPUTERNAME"));
var machineName = Environment.GetEnvironmentVariable("COMPUTERNAME");
if (string.IsNullOrWhiteSpace(machineName))
machineName = Environment.GetEnvironmentVariable("HOSTNAME");

_cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, machineName);
#endif
logEvent.AddPropertyIfAbsent(_cachedProperty);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog.Enrichers.Environment/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.1-*",
"version": "2.1.0-*",
"description": "Enrich Serilog log events with properties from System.Environment.",
"authors": [
"Serilog Contributors"
Expand Down

0 comments on commit 2aa420a

Please sign in to comment.