Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Changed project to multi target (netstandard2.0;net45). #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,4 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
/.vs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.2.2.1\lib\net45\Serilog.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\packages\Serilog.2.9.0\lib\net45\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.Enrichers.Thread, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.Enrichers.Thread.2.0.0\lib\net45\Serilog.Enrichers.Thread.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\packages\Serilog.Enrichers.Thread.3.1.0\lib\net45\Serilog.Enrichers.Thread.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.ColoredConsole, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.Sinks.ColoredConsole.2.0.0\lib\net45\Serilog.Sinks.ColoredConsole.dll</HintPath>
<Private>True</Private>
<Reference Include="Serilog.Sinks.ColoredConsole, Version=3.0.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.Sinks.ColoredConsole.3.0.1\lib\net45\Serilog.Sinks.ColoredConsole.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.Console, Version=3.0.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.Sinks.Console.3.0.1\lib\net45\Serilog.Sinks.Console.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -67,7 +66,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj">
<Project>{83ea2b05-ff47-40c8-92c3-1f58aeec7ce0}</Project>
<Project>{6f098c9c-3134-4cd5-8caf-bbc79d4bfc81}</Project>
<Name>Serilog.Sinks.Log4Net</Name>
</ProjectReference>
</ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions Sample/Serilog.Sinks.Log4Net.Sample/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.5" targetFramework="net451" />
<package id="Serilog" version="2.2.1" targetFramework="net451" />
<package id="Serilog.Enrichers.Thread" version="2.0.0" targetFramework="net451" />
<package id="Serilog.Sinks.ColoredConsole" version="2.0.0" targetFramework="net451" />
<package id="log4net" version="2.0.8" targetFramework="net451" />
<package id="Serilog" version="2.9.0" targetFramework="net451" />
<package id="Serilog.Enrichers.Thread" version="3.1.0" targetFramework="net451" />
<package id="Serilog.Sinks.ColoredConsole" version="3.0.1" targetFramework="net451" />
<package id="Serilog.Sinks.Console" version="3.0.1" targetFramework="net451" />
</packages>
19 changes: 11 additions & 8 deletions serilog-sinks-log4net.sln
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio Version 16
VisualStudioVersion = 16.0.29609.76
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net", "src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj", "{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{FC737230-09E6-42BD-894C-613842FA30B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net.Sample", "Sample\Serilog.Sinks.Log4Net.Sample\Serilog.Sinks.Log4Net.Sample.csproj", "{7FF6875B-62E3-433A-803A-AB9F9F09834B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net", "src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj", "{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.Build.0 = Release|Any CPU
{7FF6875B-62E3-433A-803A-AB9F9F09834B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FF6875B-62E3-433A-803A-AB9F9F09834B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FF6875B-62E3-433A-803A-AB9F9F09834B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FF6875B-62E3-433A-803A-AB9F9F09834B}.Release|Any CPU.Build.0 = Release|Any CPU
{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7FF6875B-62E3-433A-803A-AB9F9F09834B} = {FC737230-09E6-42BD-894C-613842FA30B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2923C285-4274-47CC-8270-7E96D4B06AB5}
EndGlobalSection
EndGlobal
5 changes: 0 additions & 5 deletions src/Serilog.Sinks.Log4Net/Properties/AssemblyInfo.cs

This file was deleted.

87 changes: 16 additions & 71 deletions src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.csproj
Original file line number Diff line number Diff line change
@@ -1,78 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Serilog</RootNamespace>
<AssemblyName>Serilog.Sinks.Log4Net</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Serilog.Sinks.Log4Net.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Serilog.Sinks.Log4Net.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>C:\Users\Mathias\Source\Repos\mparge\serilog-sinks-log4net\assets\Serilog.snk</AssemblyOriginatorKeyFile>
<Copyright>Copyright © Serilog Contributors 2014</Copyright>
<Company />
<Product />
<FileVersion>1.1.1.1</FileVersion>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\assets\Serilog.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\..\packages\Serilog.2.2.1\lib\net45\Serilog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup>
<Compile Include="LoggerConfigurationLog4NetExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\..\assets\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Sinks\Log4Net\Log4NetSink.cs" />
<None Include="..\..\assets\Serilog.snk" Link="Serilog.snk" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\assets\Serilog.snk">
<Link>Serilog.snk</Link>
</None>
<None Include="packages.config" />
<None Include="Serilog.Sinks.Log4Net.nuspec">
<SubType>Designer</SubType>
</None>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
4 changes: 2 additions & 2 deletions src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<description>Serilog event sink that writes to Log4Net. Merge your new Serilog event stream into your existing log4net infrastructure.</description>
<tags>serilog logging log4net</tags>
<dependencies>
<dependency id="Serilog" version="2.0.0" />
<dependency id="log4net" version="2.0.5" />
<dependency id="Serilog" version="2.9.0" />
<dependency id="log4net" version="2.0.8" />
</dependencies>
</metadata>
</package>
6 changes: 3 additions & 3 deletions src/Serilog.Sinks.Log4Net/Sinks/Log4Net/Log4NetSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

using System;
using System.Security.AccessControl;
using Serilog.Core;
using Serilog.Debugging;
using Serilog.Events;
using log4net;
using System.Reflection;

namespace Serilog.Sinks.Log4Net
{
Expand Down Expand Up @@ -55,8 +55,8 @@ public void Emit(LogEvent logEvent)

var message = logEvent.RenderMessage(_formatProvider);
var exception = logEvent.Exception;

var logger = LogManager.GetLogger(loggerName);
var logger = LogManager.GetLogger(Assembly.GetCallingAssembly(), loggerName);

using (_supplyContextMessage ? ThreadContext.Stacks["NDC"].Push(ContextMessage) : new NullDisposable())
{
Expand Down