Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Ship formatters in separate nuget package #208

Merged
merged 9 commits into from
Jan 27, 2019
Merged
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: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,7 @@ FakesAssemblies/

project.lock.json
.vs

# JetBrains Rider
.idea/
*.sln.iml
11 changes: 8 additions & 3 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ echo "In directory: $PSScriptRoot"

$solution = "serilog-sinks-elasticsearch.sln"
$test = "test\\Serilog.Sinks.Elasticsearch.Tests\\Serilog.Sinks.Elasticsearch.Tests.csproj"
$projectFolder = "src\\Serilog.Sinks.Elasticsearch"
$project = $projectFolder + "\\Serilog.Sinks.Elasticsearch.csproj"
[string[]]$projects = @(
("src\\Serilog.Sinks.Elasticsearch\\Serilog.Sinks.Elasticsearch.csproj"),
("src\\Serilog.Formatting.Elasticsearch\\Serilog.Formatting.Elasticsearch.csproj")
)

function Invoke-Build()
{
Expand All @@ -22,7 +24,10 @@ function Invoke-Build()
}

Write-Output "Creating packages"
& dotnet pack $project -c Release -o ..\..\artifacts --include-symbols --include-source /p:PackageVersion=$env:GitVersion_NuGetVersionV2
foreach ($project in $projects)
{
& dotnet pack $project -c Release -o ..\..\artifacts --include-symbols --include-source /p:PackageVersion=$env:GitVersion_NuGetVersionV2
}

if($LASTEXITCODE -ne 0)
{
Expand Down
125 changes: 73 additions & 52 deletions README.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ build_script:
- ps: ./Build.ps1
test: off
artifacts:
- path: artifacts/Serilog.Sinks.Elasticsearch*.nupkg
- path: artifacts/Serilog.Sinks.Elasticsearch*.nupkg
- path: artifacts/Serilog.Formatting.Elasticsearch*.nupkg
only_commits:
files:
- serilog-sinks-elasticsearch.sln
- src/Serilog.Sinks.Elasticsearch/
- src/Serilog.Formatting.Elasticsearch/
- nuget.config
- Build.ps1
- assets/
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.1.4"
}
}
9 changes: 8 additions & 1 deletion serilog-sinks-elasticsearch.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
MinimumVisualStudioVersion = 10.0.40219.1
Expand All @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{148431F6
LICENSE = LICENSE
nuget.config = nuget.config
README.md = README.md
global.json = global.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Elasticsearch", "src\Serilog.Sinks.Elasticsearch\Serilog.Sinks.Elasticsearch.csproj", "{EEB0D119-687E-444E-BF14-9BDAEC9BA3EF}"
Expand All @@ -21,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Elasticsearch
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Elasticsearch.Sample", "sample\Serilog.Sinks.Elasticsearch.Sample\Serilog.Sinks.Elasticsearch.Sample.csproj", "{253B37AB-D82E-4A5F-BA16-F1BE398818C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Formatting.Elasticsearch", "src\Serilog.Formatting.Elasticsearch\Serilog.Formatting.Elasticsearch.csproj", "{0E6D34BF-322A-4803-94D1-355F6D5024BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,6 +42,10 @@ Global
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Release|Any CPU.Build.0 = Release|Any CPU
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013-2016 Serilog Contributors
// 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.
Expand All @@ -23,7 +23,7 @@
using Serilog.Formatting.Json;
using Serilog.Parsing;

namespace Serilog.Sinks.Elasticsearch
namespace Serilog.Formatting.Elasticsearch
{
/// <summary>
/// Formats log events in a simple JSON structure. Instances of this class
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2014 Serilog Contributors
// Copyright 2014 Serilog Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
using Serilog.Events;
using Serilog.Parsing;

namespace Serilog.Sinks.Elasticsearch
namespace Serilog.Formatting.Elasticsearch
{
/// <summary>
/// Custom Json formatter that respects the configured property name handling and forces 'Timestamp' to @timestamp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 Serilog Contributors
// Copyright 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.
Expand All @@ -17,7 +17,7 @@
using System.IO;
using Elasticsearch.Net;

namespace Serilog.Sinks.Elasticsearch
namespace Serilog.Formatting.Elasticsearch
{
/// <summary>
/// A JSON formatter which plays nice with Kibana,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Serilog.Formatting.Elasticsearch</id>
<version>$version$</version>
<authors>Michiel van Oudheusden, Martijn Laarman, Mogens Heller Grabe</authors>
<description>The perfect way for .NET apps formatting structured log events to Elasticsearch JSON.</description>
<language>en-US</language>
<projectUrl>http://serilog.net</projectUrl>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<iconUrl>http://serilog.net/images/serilog-sink-nuget.png</iconUrl>
<tags>serilog logging elasticsearch</tags>
<dependencies>
<dependency id="Serilog" version="2.6.0" />
<dependency id="Elasticsearch.Net" version="6.0.0" />
</dependencies>
</metadata>
<files>
<file src="bin\Release\Serilog.Sinks.Elasticsearch.dll" target="lib\net45" />
<file src="bin\Release\Serilog.Sinks.Elasticsearch.pdb" target="lib\net45" />
<file src="**\*.cs" target="src" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Serilog.Formatting.Elasticsearch</id>
<version>$version$</version>
<authors>Michiel van Oudheusden, Martijn Laarman, Mogens Heller Grabe, Konstantin Erman</authors>
<description>The perfect way for .NET apps formatting structured log events to Elasticsearch JSON.</description>
<language>en-US</language>
<projectUrl>http://serilog.net</projectUrl>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<iconUrl>http://serilog.net/images/serilog-sink-nuget.png</iconUrl>
<repository type="git" url="https://github.com/serilog/serilog-sinks-elasticsearch" />
<tags>serilog logging elasticsearch</tags>
<dependencies>
<dependency id="Serilog" version="2.6.0" />
<dependency id="Elasticsearch.Net" version="6.0.0" />
</dependencies>
</metadata>
<files>
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
<Authors>Michiel van Oudheusden, Martijn Laarman, Mogens Heller Grabe, Serilog Contributors</Authors>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Serilog.Formatting.Elasticsearch</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>Serilog.Formatting.Elasticsearch</PackageId>
<PackageTags>serilog;elasticsearch;logging;event;formatting</PackageTags>
<PackageReleaseNotes>https://github.com/serilog/serilog-sinks-elasticsearch/blob/master/CHANGES.md</PackageReleaseNotes>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-elasticsearch</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<RepositoryUrl>https://github.com/serilog/serilog-sinks-elasticsearch</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<RootNamespace>Serilog.Formatting.ElasticSearch</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Elasticsearch.Net" Version="6.0.0" />
<PackageReference Include="Serilog" Version="2.6.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);DOTNETCORE;NO_SERIALIZATION</DefineConstants>
</PropertyGroup>

<ItemGroup>
<DotNetCliToolReference Include="dotnet-version" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@
<DotNetCliToolReference Include="dotnet-version" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Serilog.Formatting.Elasticsearch\Serilog.Formatting.Elasticsearch.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Serilog.Debugging;
using Serilog.Events;
using Serilog.Formatting;
using Serilog.Formatting.Elasticsearch;

namespace Serilog.Sinks.Elasticsearch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Linq;
using System.Text;
using Serilog.Formatting.Elasticsearch;
using Xunit;

namespace Serilog.Sinks.Elasticsearch.Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Newtonsoft.Json.Converters;
using Xunit;
using Serilog.Events;
using Serilog.Formatting.Elasticsearch;
using Serilog.Parsing;
using Serilog.Sinks.Elasticsearch.Tests.Domain;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
<EmbeddedResource Include="Templating\template.json" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Formatting.Elasticsearch\Serilog.Formatting.Elasticsearch.csproj" />
<ProjectReference Include="..\..\src\Serilog.Sinks.Elasticsearch\Serilog.Sinks.Elasticsearch.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Elasticsearch.Net" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
Expand Down Expand Up @@ -66,10 +71,6 @@
<DotNetCliToolReference Include="dotnet-version" Version="1.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Elasticsearch\Serilog.Sinks.Elasticsearch.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down