Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ publish/
*.publishproj

# NuGet Packages
*.nupkg
#*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
Expand Down Expand Up @@ -181,3 +181,5 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
/.vs/serilog-sinks-log4net/v16/Server/sqlite3
/.vs
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: csharp
mono: none
solution: serilog-sinks-log4net.sln
dotnet: 3.1.100
script:
- dotnet restore

Binary file not shown.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Serilog.Sinks.Log4Net
Serilog.Sinks.Log4Net.NetStandard

[![Build status](https://ci.appveyor.com/api/projects/status/bi8o8f5jteqvb0e5/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-log4net/branch/master)
[![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Log4Net.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Log4Net/)
[![Build status](https://ci.appveyor.com/api/projects/status/j2axn2v9pn63ya98/branch/master?svg=true)](https://ci.appveyor.com/project/BuddyWork/serilog-sinks-log4net/branch/master)
[![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Log4Net.NetStandard.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Log4Net.NetStandard/)

Duplicates Serilog events through the log4net pipeline to allow integration with existing code and libraries.

Expand Down
10 changes: 1 addition & 9 deletions Sample/Serilog.Sinks.Log4Net.Sample/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[LOG4NET] %date (%thread) %-5level %logger - %message%newline" />
</layout>
Expand All @@ -14,12 +14,4 @@
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Serilog" publicKeyToken="24c2f752a8e58a10" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
10 changes: 4 additions & 6 deletions Sample/Serilog.Sinks.Log4Net.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Reflection;
using log4net;
using log4net.Config;
using Serilog.Enrichers;
Expand All @@ -17,11 +15,11 @@ internal class Program

private static void Main()
{
XmlConfigurator.Configure();
XmlConfigurator.Configure(LogManager.GetRepository(Assembly.GetCallingAssembly()), new FileInfo("Serilog.Sinks.Log4Net.Sample.dll.config"));

Log.Logger = new LoggerConfiguration()
.Enrich.With(new ThreadIdEnricher())
.WriteTo.ColoredConsole(outputTemplate: OutputTemplate)
.WriteTo.Console(outputTemplate: OutputTemplate)
.WriteTo.Log4Net()
.CreateLogger();

Expand Down
18 changes: 1 addition & 17 deletions Sample/Serilog.Sinks.Log4Net.Sample/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Serilog.Sinks.Log4Net.Sample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Serilog.Sinks.Log4Net.Sample")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -22,15 +18,3 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1492660d-0acb-410a-b410-7df001de7152")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -1,82 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{7FF6875B-62E3-433A-803A-AB9F9F09834B}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Serilog.Sinks.Log4Net.Sample</RootNamespace>
<AssemblyName>Serilog.Sinks.Log4Net.Sample</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<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>
<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="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>
</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>
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj">
<Project>{83ea2b05-ff47-40c8-92c3-1f58aeec7ce0}</Project>
<Name>Serilog.Sinks.Log4Net</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Project Sdk="">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<BaseOutputPath>bin\</BaseOutputPath>
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<AssemblyName>Serilog.Sinks.Log4Net.Sample</AssemblyName>
<RootNamespace>Serilog.Sinks.Log4Net.Sample</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
</PropertyGroup>

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />

<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.ColoredConsole" Version="3.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj" />
</ItemGroup>
</Project>
7 changes: 0 additions & 7 deletions Sample/Serilog.Sinks.Log4Net.Sample/packages.config

This file was deleted.

30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2.0.{build}
image: Visual Studio 2019
configuration: Release
platform: Any CPU
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
version_prefix: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
build_script:
- cmd: dotnet build serilog-sinks-log4net.sln --configuration Release
artifacts:
- path: src\Serilog.Sinks.Log4Net\bin\Release\Serilog.Sinks.Log4Net.NetStandard.*.nupkg
name: serilog-sinks-log4net.NetStandard
deploy:
- provider: NuGet
server: nuget.org
api_key:
secure: pEQZL9F9mA45N0pwesIvBiQqHvGIqRNz12yGsnWzKQji1OKqm+MHONlAOGJq7PFV

6 changes: 3 additions & 3 deletions assets/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.1.1.1")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0")]
Binary file added nuget/Serilog.Sinks.Log4Net.2.0.0.nupkg
Binary file not shown.
3 changes: 1 addition & 2 deletions src/Serilog.Sinks.Log4Net/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;

[assembly: AssemblyTitle("Serilog.Sinks.Log4Net")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2014")]
[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2019")]
Loading