diff --git a/Serilog.sln b/Serilog.sln index d1d8d145c..167376949 100644 --- a/Serilog.sln +++ b/Serilog.sln @@ -23,12 +23,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Tests", "test\Seril EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Settings.AppSettings", "src\Serilog.Settings.AppSettings\Serilog.Settings.AppSettings.xproj", "{0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Enrichers.Environment", "src\Serilog.Enrichers.Environment\Serilog.Enrichers.Environment.xproj", "{B884782D-6C07-4779-9074-D97F622799A9}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Enrichers.Process", "src\Serilog.Enrichers.Process\Serilog.Enrichers.Process.xproj", "{2312A998-5E53-4355-9CB6-6014252B3E88}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Enrichers.Thread", "src\Serilog.Enrichers.Thread\Serilog.Enrichers.Thread.xproj", "{E0BD3797-55A5-4E8C-8DE7-8487BEB75914}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -47,18 +41,6 @@ Global {0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4}.Release|Any CPU.Build.0 = Release|Any CPU - {B884782D-6C07-4779-9074-D97F622799A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B884782D-6C07-4779-9074-D97F622799A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B884782D-6C07-4779-9074-D97F622799A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B884782D-6C07-4779-9074-D97F622799A9}.Release|Any CPU.Build.0 = Release|Any CPU - {2312A998-5E53-4355-9CB6-6014252B3E88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2312A998-5E53-4355-9CB6-6014252B3E88}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2312A998-5E53-4355-9CB6-6014252B3E88}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2312A998-5E53-4355-9CB6-6014252B3E88}.Release|Any CPU.Build.0 = Release|Any CPU - {E0BD3797-55A5-4E8C-8DE7-8487BEB75914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0BD3797-55A5-4E8C-8DE7-8487BEB75914}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0BD3797-55A5-4E8C-8DE7-8487BEB75914}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0BD3797-55A5-4E8C-8DE7-8487BEB75914}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -67,8 +49,5 @@ Global {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C} = {037440DE-440B-4129-9F7A-09B42D00397E} {3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} {0D9F37E3-2CB4-4C0D-A307-32BB71DEFDD4} = {037440DE-440B-4129-9F7A-09B42D00397E} - {B884782D-6C07-4779-9074-D97F622799A9} = {037440DE-440B-4129-9F7A-09B42D00397E} - {2312A998-5E53-4355-9CB6-6014252B3E88} = {037440DE-440B-4129-9F7A-09B42D00397E} - {E0BD3797-55A5-4E8C-8DE7-8487BEB75914} = {037440DE-440B-4129-9F7A-09B42D00397E} EndGlobalSection EndGlobal diff --git a/src/Serilog.Enrichers.Environment/Enrichers/EnvironmentUserNameEnricher.cs b/src/Serilog.Enrichers.Environment/Enrichers/EnvironmentUserNameEnricher.cs deleted file mode 100644 index 08ec13c21..000000000 --- a/src/Serilog.Enrichers.Environment/Enrichers/EnvironmentUserNameEnricher.cs +++ /dev/null @@ -1,60 +0,0 @@ -// 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. - -#if !DOTNET5_1 - -using System; -using Serilog.Core; -using Serilog.Events; - -namespace Serilog.Enrichers -{ - /// - /// Enriches log events with an EnvironmentUserName property containing [\]. - /// - public class EnvironmentUserNameEnricher : ILogEventEnricher - { - LogEventProperty _cachedProperty; - - /// - /// The property name added to enriched log events. - /// - public const string EnvironmentUserNamePropertyName = "EnvironmentUserName"; - - /// - /// Enrich the log event. - /// - /// The log event to enrich. - /// Factory for creating new properties to add to the event. - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { - _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(EnvironmentUserNamePropertyName, GetEnvironmentUserName()); - logEvent.AddPropertyIfAbsent(_cachedProperty); - } - - private static string GetEnvironmentUserName() - { -#if !DOTNET5_4 - var userDomainName = Environment.UserDomainName; - var userName = Environment.UserName; -#else - var userDomainName = Environment.GetEnvironmentVariable("USERNAME"); - var userName = Environment.GetEnvironmentVariable("USERDOMAIN"); -#endif - return !string.IsNullOrWhiteSpace(userDomainName) ? $@"{userDomainName}\{userName}" : userName; - } - } -} - -#endif diff --git a/src/Serilog.Enrichers.Environment/Enrichers/MachineNameEnricher.cs b/src/Serilog.Enrichers.Environment/Enrichers/MachineNameEnricher.cs deleted file mode 100644 index 262004407..000000000 --- a/src/Serilog.Enrichers.Environment/Enrichers/MachineNameEnricher.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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.Core; -using Serilog.Events; -using System.Runtime.InteropServices; - -namespace Serilog.Enrichers -{ - /// - /// Enriches log events with a MachineName property containing . - /// - public class MachineNameEnricher : ILogEventEnricher - { - LogEventProperty _cachedProperty; - - /// - /// The property name added to enriched log events. - /// - public const string MachineNamePropertyName = "MachineName"; - - /// - /// Enrich the log event. - /// - /// The log event to enrich. - /// Factory for creating new properties to add to the event. - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { -#if !DOTNET5_4 - _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.MachineName); -#else - _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.GetEnvironmentVariable("COMPUTERNAME")); -#endif - logEvent.AddPropertyIfAbsent(_cachedProperty); - } - } -} diff --git a/src/Serilog.Enrichers.Environment/EnvironmentLoggerConfigurationExtensions.cs b/src/Serilog.Enrichers.Environment/EnvironmentLoggerConfigurationExtensions.cs deleted file mode 100644 index e6b07c2d6..000000000 --- a/src/Serilog.Enrichers.Environment/EnvironmentLoggerConfigurationExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -// 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 -{ - /// - /// Extends to add enrichers for . - /// capabilities. - /// - public static class EnvironmentLoggerConfigurationExtensions - { - /// - /// Enrich log events with a MachineName property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - public static LoggerConfiguration WithMachineName( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } - - /// - /// Enriches log events with an EnvironmentUserName property containing [\]. - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - public static LoggerConfiguration WithEnvironmentUserName( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } - - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Environment/Properties/AssemblyInfo.cs b/src/Serilog.Enrichers.Environment/Properties/AssemblyInfo.cs deleted file mode 100644 index e6a0a372f..000000000 --- a/src/Serilog.Enrichers.Environment/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System; -using System.Reflection; - -[assembly: AssemblyVersion("2.0.0.0")] - -[assembly: CLSCompliant(true)] diff --git a/src/Serilog.Enrichers.Environment/Serilog.Enrichers.Environment.xproj b/src/Serilog.Enrichers.Environment/Serilog.Enrichers.Environment.xproj deleted file mode 100644 index 68eace52f..000000000 --- a/src/Serilog.Enrichers.Environment/Serilog.Enrichers.Environment.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - b884782d-6c07-4779-9074-d97f622799a9 - Serilog - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Serilog.Enrichers.Environment/project.json b/src/Serilog.Enrichers.Environment/project.json deleted file mode 100644 index ec918717f..000000000 --- a/src/Serilog.Enrichers.Environment/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "2.0.0-beta-*", - "description": "Enrich Serilog log events with properties from System.Environment.", - "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-enricher-nuget.png", - "dependencies": { - "Serilog": { "target": "project" } - }, - "compilationOptions": { - "keyFile": "../../assets/Serilog.snk" - }, - "frameworks": { - "net45": { - }, - "dotnet5.4": { - "dependencies": { - "System.Runtime.Extensions": "4.0.11-beta-23516" - } - } - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Process/Enrichers/ProcessIdEnricher.cs b/src/Serilog.Enrichers.Process/Enrichers/ProcessIdEnricher.cs deleted file mode 100644 index 7e1c1494e..000000000 --- a/src/Serilog.Enrichers.Process/Enrichers/ProcessIdEnricher.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2013-2015 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 Serilog.Core; -using Serilog.Events; - -namespace Serilog.Enrichers -{ - /// - /// Enriches log events with a ProcessId property containing the current . - /// - public class ProcessIdEnricher : ILogEventEnricher - { - LogEventProperty _cachedProperty; - - /// - /// The property name added to enriched log events. - /// - public const string ProcessIdPropertyName = "ProcessId"; - - /// - /// Enrich the log event. - /// - /// The log event to enrich. - /// Factory for creating new properties to add to the event. - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { - _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(ProcessIdPropertyName, System.Diagnostics.Process.GetCurrentProcess().Id); - logEvent.AddPropertyIfAbsent(_cachedProperty); - } - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Process/ProcessLoggerConfigurationExtensions.cs b/src/Serilog.Enrichers.Process/ProcessLoggerConfigurationExtensions.cs deleted file mode 100644 index 8b7ba678b..000000000 --- a/src/Serilog.Enrichers.Process/ProcessLoggerConfigurationExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 -{ - /// - /// Extends to add enrichers related to process. - /// capabilities. - /// - public static class ProcessLoggerConfigurationExtensions - { - /// - /// Enrich log events with a ProcessId property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - public static LoggerConfiguration WithProcessId( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Process/Properties/AssemblyInfo.cs b/src/Serilog.Enrichers.Process/Properties/AssemblyInfo.cs deleted file mode 100644 index e6a0a372f..000000000 --- a/src/Serilog.Enrichers.Process/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System; -using System.Reflection; - -[assembly: AssemblyVersion("2.0.0.0")] - -[assembly: CLSCompliant(true)] diff --git a/src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.xproj b/src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.xproj deleted file mode 100644 index 4f211f728..000000000 --- a/src/Serilog.Enrichers.Process/Serilog.Enrichers.Process.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 2312a998-5e53-4355-9cb6-6014252b3e88 - Serilog - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Serilog.Enrichers.Process/project.json b/src/Serilog.Enrichers.Process/project.json deleted file mode 100644 index cfaee2f04..000000000 --- a/src/Serilog.Enrichers.Process/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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-enricher-nuget.png", - "dependencies": { - "Serilog": { "target": "project" } - }, - "compilationOptions": { - "keyFile": "../../assets/Serilog.snk" - }, - "frameworks": { - "net45": { - }, - "dotnet5.1": { - "dependencies": { - "System.Diagnostics.Process": "4.1.0-beta-23409" - } - } - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs b/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs deleted file mode 100644 index f588f902a..000000000 --- a/src/Serilog.Enrichers.Thread/Enrichers/ThreadIdEnricher.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2013-2015 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.Threading; -using Serilog.Core; -using Serilog.Events; - -namespace Serilog.Enrichers -{ - /// - /// Enriches log events with a ThreadId property containing the current . - /// - public class ThreadIdEnricher : ILogEventEnricher - { - /// - /// The property name added to enriched log events. - /// - public const string ThreadIdPropertyName = "ThreadId"; - - /// - /// Enrich the log event. - /// - /// The log event to enrich. - /// Factory for creating new properties to add to the event. - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { - logEvent.AddPropertyIfAbsent(new LogEventProperty(ThreadIdPropertyName, new ScalarValue(Thread.CurrentThread.ManagedThreadId))); - } - } -} diff --git a/src/Serilog.Enrichers.Thread/Properties/AssemblyInfo.cs b/src/Serilog.Enrichers.Thread/Properties/AssemblyInfo.cs deleted file mode 100644 index e6a0a372f..000000000 --- a/src/Serilog.Enrichers.Thread/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System; -using System.Reflection; - -[assembly: AssemblyVersion("2.0.0.0")] - -[assembly: CLSCompliant(true)] diff --git a/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.xproj b/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.xproj deleted file mode 100644 index 0d5aa2c5d..000000000 --- a/src/Serilog.Enrichers.Thread/Serilog.Enrichers.Thread.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - e0bd3797-55a5-4e8c-8de7-8487beb75914 - Serilog - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Serilog.Enrichers.Thread/ThreadLoggerConfigurationExtensions.cs b/src/Serilog.Enrichers.Thread/ThreadLoggerConfigurationExtensions.cs deleted file mode 100644 index 2897d6a36..000000000 --- a/src/Serilog.Enrichers.Thread/ThreadLoggerConfigurationExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -// 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 -{ - /// - /// Extends to add enrichers for . - /// capabilities. - /// - public static class ThreadLoggerConfigurationExtensions - { - /// - /// Enrich log events with a ThreadId property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - /// - public static LoggerConfiguration WithThreadId( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } - } -} \ No newline at end of file diff --git a/src/Serilog.Enrichers.Thread/project.json b/src/Serilog.Enrichers.Thread/project.json deleted file mode 100644 index 194c075de..000000000 --- a/src/Serilog.Enrichers.Thread/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "2.0.0-beta-*", - "description": "Enrich Serilog events with properties from the current thread.", - "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-enricher-nuget.png", - "dependencies": { - "Serilog": { "target": "project" } - }, - "compilationOptions": { - "keyFile": "../../assets/Serilog.snk" - }, - "frameworks": { - "net45": { - }, - "dotnet5.1": { - } - } -} \ No newline at end of file diff --git a/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs b/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs deleted file mode 100644 index b1fb706ad..000000000 --- a/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs +++ /dev/null @@ -1,27 +0,0 @@ -#if PROCESS - -using Serilog.Events; -using Serilog.Tests.Support; -using Xunit; - -namespace Serilog.Tests.Enrichers -{ - public class EnvironmentUserNameEnricherTests - { - [Fact] - public void EnvironmentUserNameEnricherIsApplied() - { - LogEvent evt = null; - var log = new LoggerConfiguration() - .Enrich.WithEnvironmentUserName() - .WriteTo.Sink(new DelegatingSink(e => evt = e)) - .CreateLogger(); - - log.Information(@"Has an EnvironmentUserName property with [domain\]userName"); - - Assert.NotNull(evt); - Assert.NotEmpty((string)evt.Properties["EnvironmentUserName"].LiteralValue()); - } - } -} -#endif diff --git a/test/Serilog.Tests/project.json b/test/Serilog.Tests/project.json index c9320f51a..8104aa14a 100644 --- a/test/Serilog.Tests/project.json +++ b/test/Serilog.Tests/project.json @@ -11,13 +11,14 @@ "xunit": "2.1.0", "xunit.runner.visualstudio": "2.1.0", "xunit.runner.dnx": "2.1.0-rc1-build204", - "Serilog.Enrichers.Environment": { "target": "project" }, - "Serilog.Enrichers.Thread": { "target": "project" }, - "Serilog.Enrichers.Process": { "target": "project" }, "Serilog.Sinks.TextWriter": "2.0.0-beta-519", "Serilog.Sinks.RollingFile": "2.0.0-beta-519", "Serilog.Sinks.PeriodicBatching": "2.0.0-beta-519", - "Serilog.Sinks.Observable": "2.0.0-beta-519" + "Serilog.Sinks.Observable": "2.0.0-beta-519", + "Serilog.Enrichers.Environment": "2.0.0-beta-519", + "Serilog.Enrichers.Process": "2.0.0-beta-519", + "Serilog.Enrichers.Thread": "2.0.0-beta-519" + }, "frameworks": { "dnx452": {