Skip to content

Commit 2f9eb01

Browse files
authored
Merge pull request #68 from merbla/dotnetcore-update
DotNet Core 2 Updates
2 parents 205670e + aee93ae commit 2f9eb01

File tree

7 files changed

+37
-29
lines changed

7 files changed

+37
-29
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
- os: linux # Ubuntu 14.04
66
dist: trusty
77
sudo: required
8-
dotnet: 1.0.4
8+
dotnet: 2.0.0
99

1010
script:
1111
- ./build.sh

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ dotnet restore
55

66
for path in src/**/*.csproj; do
77
dotnet build -f netstandard1.1 -c Release ${path}
8+
dotnet build -f netstandard1.3 -c Release ${path}
89
done
910

1011
for path in test/*.Tests/*.csproj; do
11-
dotnet test -f netcoreapp1.0 -c Release ${path}
12+
dotnet test -f netcoreapp2.0 -c Release ${path}
1213
done
1314

14-
dotnet build -f netcoreapp1.0 -c Release sample/Sample/Sample.csproj
15+
dotnet build -f netcoreapp2.0 -c Release sample/Sample/Sample.csproj

sample/Sample/Program.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static void WithCompactSplunkFormatter(int eventsToCreate)
4747
// Vanilla Test with full uri specified
4848
Log.Logger = new LoggerConfiguration()
4949
.MinimumLevel.Debug()
50-
.WriteTo.LiterateConsole()
50+
.WriteTo.Console()
5151
.WriteTo.EventCollector(
5252
SPLUNK_FULL_ENDPOINT,
5353
Program.EventCollectorToken, new CompactSplunkJsonFormatter())
@@ -70,7 +70,7 @@ public static void OverridingSource(int eventsToCreate)
7070
// Override Source
7171
Log.Logger = new LoggerConfiguration()
7272
.MinimumLevel.Debug()
73-
.WriteTo.LiterateConsole()
73+
.WriteTo.Console()
7474
.WriteTo.EventCollector(
7575
SPLUNK_ENDPOINT,
7676
Program.EventCollectorToken,
@@ -92,7 +92,7 @@ public static void OverridingSourceType(int eventsToCreate)
9292
// Override Source
9393
Log.Logger = new LoggerConfiguration()
9494
.MinimumLevel.Debug()
95-
.WriteTo.LiterateConsole()
95+
.WriteTo.Console()
9696
.WriteTo.EventCollector(
9797
SPLUNK_ENDPOINT,
9898
Program.EventCollectorToken,
@@ -114,7 +114,7 @@ public static void OverridingHost(int eventsToCreate)
114114
// Override Host
115115
Log.Logger = new LoggerConfiguration()
116116
.MinimumLevel.Debug()
117-
.WriteTo.LiterateConsole()
117+
.WriteTo.Console()
118118
.WriteTo.EventCollector(
119119
SPLUNK_ENDPOINT,
120120
Program.EventCollectorToken,
@@ -136,7 +136,7 @@ public static void UsingFullUri(int eventsToCreate)
136136
// Vanilla Test with full uri specified
137137
Log.Logger = new LoggerConfiguration()
138138
.MinimumLevel.Debug()
139-
.WriteTo.LiterateConsole()
139+
.WriteTo.Console()
140140
.WriteTo.EventCollector(
141141
SPLUNK_FULL_ENDPOINT,
142142
Program.EventCollectorToken)
@@ -158,7 +158,7 @@ public static void UsingHostOnly(int eventsToCreate)
158158
// Vanilla Tests just host
159159
Log.Logger = new LoggerConfiguration()
160160
.MinimumLevel.Debug()
161-
.WriteTo.LiterateConsole()
161+
.WriteTo.Console()
162162
.WriteTo.EventCollector(
163163
SPLUNK_ENDPOINT,
164164
Program.EventCollectorToken)
@@ -179,7 +179,7 @@ public static void WithNoTemplate(int eventsToCreate)
179179
// No Template
180180
Log.Logger = new LoggerConfiguration()
181181
.MinimumLevel.Debug()
182-
.WriteTo.LiterateConsole()
182+
.WriteTo.Console()
183183
.WriteTo.EventCollector(
184184
SPLUNK_ENDPOINT,
185185
Program.EventCollectorToken,
@@ -201,7 +201,7 @@ public static void UsingSSL(int eventsToCreate)
201201
// SSL
202202
Log.Logger = new LoggerConfiguration()
203203
.MinimumLevel.Debug()
204-
.WriteTo.LiterateConsole()
204+
.WriteTo.Console()
205205
.WriteTo.EventCollector(
206206
SPLUNK_ENDPOINT,
207207
Program.EventCollectorToken)
@@ -228,7 +228,7 @@ public static void AddCustomFields(int eventsToCreate)
228228
// Override Source
229229
Log.Logger = new LoggerConfiguration()
230230
.MinimumLevel.Debug()
231-
.WriteTo.LiterateConsole()
231+
.WriteTo.Console()
232232
.WriteTo.EventCollector(
233233
splunkHost: SPLUNK_ENDPOINT
234234
, eventCollectorToken: SPLUNK_HEC_TOKEN

sample/Sample/Sample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp1.0</TargetFramework>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Serilog" Version="2.4.0" />
10-
<PackageReference Include="Serilog.Sinks.Literate" Version="2.1.0" />
9+
<PackageReference Include="Serilog" Version="2.5.0" />
10+
<PackageReference Include="Serilog.Sinks.Console" Version="3.0.1" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/Serilog.Sinks.Splunk/Serilog.Sinks.Splunk.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>The Splunk Sink for Serilog</Description>
55
<VersionPrefix>2.3.1</VersionPrefix>
66
<Authors>Matthew Erbs, Serilog Contributors</Authors>
7-
<TargetFrameworks>net45;netstandard1.1</TargetFrameworks>
7+
<TargetFrameworks>net45;netstandard1.1;netstandard1.3</TargetFrameworks>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
99
<AssemblyName>Serilog.Sinks.Splunk</AssemblyName>
1010
<PackageId>Serilog.Sinks.Splunk</PackageId>
@@ -27,16 +27,17 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
30-
<PackageReference Include="System.Collections" Version="4.0.11" />
31-
<PackageReference Include="System.Collections.Concurrent" Version="4.0.12" />
32-
<PackageReference Include="System.Runtime" Version="4.1.0" />
33-
<PackageReference Include="System.Threading" Version="4.0.11" />
34-
<PackageReference Include="System.Net.Http" Version="4.1.1" />
30+
<PackageReference Include="System.Net.Http" Version="4.3.0" />
31+
</ItemGroup>
32+
33+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
34+
<PackageReference Include="System.Net.Http" Version="4.3.0" />
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<PackageReference Include="Serilog" Version="2.4.0" />
38+
<PackageReference Include="Serilog" Version="2.5.0" />
3939
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.1.1" />
40+
<PackageReference Include="System.Net.Http" Version="4.3.2" />
4041
</ItemGroup>
4142

4243
</Project>

src/Serilog.Sinks.Splunk/Sinks/Splunk/SplunkJsonFormatter.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@
2222

2323
namespace Serilog.Sinks.Splunk
2424
{
25+
/// <inheritdoc />
2526
/// <summary>
2627
/// Renders log events into a default JSON format for consumption by Splunk.
2728
/// </summary>
2829
public class SplunkJsonFormatter : ITextFormatter
2930
{
3031
static readonly JsonValueFormatter ValueFormatter = new JsonValueFormatter();
3132

32-
readonly bool _renderTemplate;
33-
readonly IFormatProvider _formatProvider;
34-
readonly string _suffix;
33+
private readonly bool _renderTemplate;
34+
private readonly IFormatProvider _formatProvider;
35+
private readonly string _suffix;
3536

37+
/// <inheritdoc />
3638
/// <summary>
37-
/// Construct a <see cref="SplunkJsonFormatter"/>.
39+
/// Construct a <see cref="T:Serilog.Sinks.Splunk.SplunkJsonFormatter" />.
3840
/// </summary>
3941
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
4042
/// <param name="renderTemplate">If true, the template used will be rendered and written to the output as a property named MessageTemplate</param>

test/Serilog.Sinks.Splunk.Tests/Serilog.Sinks.Splunk.Tests.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net452;netcoreapp1.0</TargetFrameworks>
4+
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
55
<AssemblyName>Serilog.Sinks.Splunk.Tests</AssemblyName>
66
<PackageId>Serilog.Sinks.Splunk.Tests</PackageId>
77
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
@@ -25,8 +25,12 @@
2525
<ProjectReference Include="..\..\src\Serilog.Sinks.Splunk\Serilog.Sinks.Splunk.csproj" />
2626
</ItemGroup>
2727

28-
<ItemGroup>
29-
<Reference Include="System.Net.Http" />
28+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
29+
<PackageReference Include="System.Net.Http" Version="4.3.0" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
33+
<PackageReference Include="System.Net.Http" Version="4.3.0" />
3034
</ItemGroup>
3135

3236
<ItemGroup>

0 commit comments

Comments
 (0)