forked from serilog/serilog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved enrichers to new projects. Serilog.Enrichers.Environment contai…
…ns UserName and Machine Name. Serilog.Erichers.Thread contains ThreadId. Serilog.Enrichers.Process contains ProcessId.
- Loading branch information
Showing
18 changed files
with
304 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../Enrichers/EnvironmentUserNameEnricher.cs → .../Enrichers/EnvironmentUserNameEnricher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/Serilog.Enrichers.Environment/EnvironmentLoggerConfigurationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2013-2016 Serilog Contributors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using Serilog.Configuration; | ||
using Serilog.Enrichers; | ||
|
||
namespace Serilog | ||
{ | ||
public static class EnvironmentLoggerConfigurationExtensions | ||
{ | ||
/// <summary> | ||
/// Enrich log events with a MachineName property containing the current <see cref="Environment.MachineName"/>. | ||
/// </summary> | ||
/// <param name="enrichmentConfiguration">Logger enrichment configuration.</param> | ||
/// <returns>Configuration object allowing method chaining.</returns> | ||
public static LoggerConfiguration WithMachineName( | ||
this LoggerEnrichmentConfiguration enrichmentConfiguration) | ||
{ | ||
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); | ||
return enrichmentConfiguration.With<MachineNameEnricher>(); | ||
} | ||
|
||
/// <summary> | ||
/// Enriches log events with an EnvironmentUserName property containing [<see cref="Environment.UserDomainName"/>\]<see cref="Environment.UserName"/>. | ||
/// </summary> | ||
/// <param name="enrichmentConfiguration">Logger enrichment configuration.</param> | ||
/// <returns>Configuration object allowing method chaining.</returns> | ||
public static LoggerConfiguration WithEnvironmentUserName( | ||
this LoggerEnrichmentConfiguration enrichmentConfiguration) | ||
{ | ||
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); | ||
return enrichmentConfiguration.With<EnvironmentUserNameEnricher>(); | ||
} | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Serilog.Enrichers.Environment/Serilog.Enrichers.Environment.xproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>b884782d-6c07-4779-9074-d97f622799a9</ProjectGuid> | ||
<RootNamespace>Serilog</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "2.0.0-beta-*", | ||
"description": "The enviornment enrichers for Serilog.", | ||
"authors": [ "Serilog Contributors" ], | ||
"tags": [ "serilog", "machine", "enricher" ], | ||
"projectUrl": "http://serilog.net", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0", | ||
"iconUrl": "http://serilog.net/images/serilog-extension-nuget.png", | ||
"dependencies": { | ||
"Serilog": { "target": "project" } | ||
}, | ||
"compilationOptions": { | ||
"keyFile": "../../assets/Serilog.snk" | ||
}, | ||
"frameworks": { | ||
"net45": { | ||
}, | ||
"dotnet5.4": { | ||
"dependencies": { | ||
"System.Runtime.Extensions": "4.0.11-beta-23516" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/Serilog.Enrichers.Process/ProcessLoggerConfigurationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2013-2016 Serilog Contributors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
using System; | ||
using System.Diagnostics; | ||
using Serilog.Configuration; | ||
using Serilog.Enrichers; | ||
|
||
namespace Serilog | ||
{ | ||
public static class ProcessLoggerConfigurationExtensions | ||
{ | ||
/// <summary> | ||
/// Enrich log events with a ProcessId property containing the current <see cref="Process.Id"/>. | ||
/// </summary> | ||
/// <param name="enrichmentConfiguration">Logger enrichment configuration.</param> | ||
/// <returns>Configuration object allowing method chaining.</returns> | ||
public static LoggerConfiguration WithProcessId( | ||
this LoggerEnrichmentConfiguration enrichmentConfiguration) | ||
{ | ||
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); | ||
return enrichmentConfiguration.With<ProcessIdEnricher>(); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.xproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>2312a998-5e53-4355-9cb6-6014252b3e88</ProjectGuid> | ||
<RootNamespace>Serilog</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"version": "2.0.0-beta-*", | ||
"description": "The process enricher for Serilog.", | ||
"authors": [ "Serilog Contributors" ], | ||
"tags": [ "serilog", "process", "enricher" ], | ||
"projectUrl": "http://serilog.net", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0", | ||
"iconUrl": "http://serilog.net/images/serilog-extension-nuget.png", | ||
"dependencies": { | ||
"Serilog": { "target": "project" } | ||
}, | ||
"compilationOptions": { | ||
"keyFile": "../../assets/Serilog.snk" | ||
}, | ||
"frameworks": { | ||
"net45": { | ||
}, | ||
"dotnet5.1": { | ||
"dependencies": { | ||
"System.Diagnostics.Process": "4.1.0-beta-23409" | ||
} | ||
}, | ||
"dotnet5.4": { | ||
"dependencies": { | ||
"System.Diagnostics.Process": "4.1.0-beta-23516" | ||
} | ||
} | ||
|
||
} | ||
} |
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.xproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>e0bd3797-55a5-4e8c-8de7-8487beb75914</ProjectGuid> | ||
<RootNamespace>Serilog</RootNamespace> | ||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> | ||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
</Project> |
39 changes: 39 additions & 0 deletions
39
src/Serilog.Enrichers.Thread/ThreadLoggerConfigurationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2013-2016 Serilog Contributors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
|
||
using System; | ||
using System.Threading; | ||
using Serilog.Configuration; | ||
using Serilog.Enrichers; | ||
|
||
namespace Serilog | ||
{ | ||
public static class ThreadLoggerConfigurationExtensions | ||
{ | ||
|
||
/// <summary> | ||
/// Enrich log events with a ThreadId property containing the current <see cref="Thread.ManagedThreadId"/>. | ||
/// </summary> | ||
/// <param name="enrichmentConfiguration">Logger enrichment configuration.</param> | ||
/// <returns>Configuration object allowing method chaining.</returns> | ||
/// <exception cref="ArgumentNullException"></exception> | ||
public static LoggerConfiguration WithThreadId( | ||
this LoggerEnrichmentConfiguration enrichmentConfiguration) | ||
{ | ||
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); | ||
return enrichmentConfiguration.With<ThreadIdEnricher>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "2.0.0-beta-*", | ||
"description": "The thread enricher for Serilog.", | ||
"authors": [ "Serilog Contributors" ], | ||
"tags": [ "serilog", "thread", "enricher" ], | ||
"projectUrl": "http://serilog.net", | ||
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0", | ||
"iconUrl": "http://serilog.net/images/serilog-extension-nuget.png", | ||
"dependencies": { | ||
"Serilog": { "target": "project" } | ||
}, | ||
"compilationOptions": { | ||
"keyFile": "../../assets/Serilog.snk" | ||
}, | ||
"frameworks": { | ||
"net45": { | ||
}, | ||
"dotnet5.1": { | ||
} | ||
} | ||
} |
Oops, something went wrong.