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

Commit 3feba63

Browse files
committed
Merge branch 'vhatsura-nuget/formatter' into dev
2 parents 4f3a7ab + d52685f commit 3feba63

17 files changed

+209
-69
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,7 @@ FakesAssemblies/
189189

190190
project.lock.json
191191
.vs
192+
193+
# JetBrains Rider
194+
.idea/
195+
*.sln.iml

Build.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ echo "In directory: $PSScriptRoot"
22

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

810
function Invoke-Build()
911
{
@@ -22,7 +24,10 @@ function Invoke-Build()
2224
}
2325

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

2732
if($LASTEXITCODE -ne 0)
2833
{

README.md

Lines changed: 73 additions & 52 deletions
Large diffs are not rendered by default.

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ build_script:
55
- ps: ./Build.ps1
66
test: off
77
artifacts:
8-
- path: artifacts/Serilog.Sinks.Elasticsearch*.nupkg
8+
- path: artifacts/Serilog.Sinks.Elasticsearch*.nupkg
9+
- path: artifacts/Serilog.Formatting.Elasticsearch*.nupkg
910
only_commits:
1011
files:
1112
- serilog-sinks-elasticsearch.sln
1213
- src/Serilog.Sinks.Elasticsearch/
14+
- src/Serilog.Formatting.Elasticsearch/
1315
- nuget.config
1416
- Build.ps1
1517
- assets/

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "2.1.4"
4+
}
5+
}

serilog-sinks-elasticsearch.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
33
VisualStudioVersion = 15.0.26730.3
44
MinimumVisualStudioVersion = 10.0.40219.1
@@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{148431F6
1313
LICENSE = LICENSE
1414
nuget.config = nuget.config
1515
README.md = README.md
16+
global.json = global.json
1617
EndProjectSection
1718
EndProject
1819
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Elasticsearch", "src\Serilog.Sinks.Elasticsearch\Serilog.Sinks.Elasticsearch.csproj", "{EEB0D119-687E-444E-BF14-9BDAEC9BA3EF}"
@@ -21,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Elasticsearch
2122
EndProject
2223
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}"
2324
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Formatting.Elasticsearch", "src\Serilog.Formatting.Elasticsearch\Serilog.Formatting.Elasticsearch.csproj", "{0E6D34BF-322A-4803-94D1-355F6D5024BE}"
26+
EndProject
2427
Global
2528
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2629
Debug|Any CPU = Debug|Any CPU
@@ -39,6 +42,10 @@ Global
3942
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
4043
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
4144
{253B37AB-D82E-4A5F-BA16-F1BE398818C8}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{0E6D34BF-322A-4803-94D1-355F6D5024BE}.Release|Any CPU.Build.0 = Release|Any CPU
4249
EndGlobalSection
4350
GlobalSection(SolutionProperties) = preSolution
4451
HideSolutionNode = FALSE
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2013-2016 Serilog Contributors
1+
// Copyright 2013-2016 Serilog Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
2323
using Serilog.Formatting.Json;
2424
using Serilog.Parsing;
2525

26-
namespace Serilog.Sinks.Elasticsearch
26+
namespace Serilog.Formatting.Elasticsearch
2727
{
2828
/// <summary>
2929
/// Formats log events in a simple JSON structure. Instances of this class
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2014 Serilog Contributors
1+
// Copyright 2014 Serilog Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
2323
using Serilog.Events;
2424
using Serilog.Parsing;
2525

26-
namespace Serilog.Sinks.Elasticsearch
26+
namespace Serilog.Formatting.Elasticsearch
2727
{
2828
/// <summary>
2929
/// Custom Json formatter that respects the configured property name handling and forces 'Timestamp' to @timestamp
@@ -135,8 +135,7 @@ protected override void WriteJsonProperty(string name, object value, ref string
135135
/// </summary>
136136
protected virtual ScalarValue DotEscapeFieldName(ScalarValue value)
137137
{
138-
var s = value.Value as string;
139-
return s != null ? new ScalarValue(DotEscapeFieldName(s)) : value;
138+
return value.Value is string s ? new ScalarValue(DotEscapeFieldName(s)) : value;
140139
}
141140

142141
/// <summary>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 Serilog Contributors
1+
// Copyright 2016 Serilog Contributors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
using System.IO;
1818
using Elasticsearch.Net;
1919

20-
namespace Serilog.Sinks.Elasticsearch
20+
namespace Serilog.Formatting.Elasticsearch
2121
{
2222
/// <summary>
2323
/// A JSON formatter which plays nice with Kibana,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>Serilog.Formatting.Elasticsearch</id>
5+
<version>$version$</version>
6+
<authors>Michiel van Oudheusden, Martijn Laarman, Mogens Heller Grabe</authors>
7+
<description>The perfect way for .NET apps formatting structured log events to Elasticsearch JSON. This package contains the formatter used for the Elasticsearch Sink.</description>
8+
<language>en-US</language>
9+
<projectUrl>http://serilog.net</projectUrl>
10+
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
11+
<iconUrl>http://serilog.net/images/serilog-sink-nuget.png</iconUrl>
12+
<tags>serilog logging elasticsearch</tags>
13+
<dependencies>
14+
<dependency id="Serilog" version="2.6.0" />
15+
<dependency id="Elasticsearch.Net" version="6.0.0" />
16+
</dependencies>
17+
</metadata>
18+
<files>
19+
<file src="bin\Release\Serilog.Sinks.Elasticsearch.dll" target="lib\net45" />
20+
<file src="bin\Release\Serilog.Sinks.Elasticsearch.pdb" target="lib\net45" />
21+
<file src="**\*.cs" target="src" />
22+
</files>
23+
</package>

0 commit comments

Comments
 (0)