Skip to content

Commit cf4f6b8

Browse files
committed
Added sample and removed old files. Version bump
1 parent 7d45daf commit cf4f6b8

File tree

6 files changed

+60
-55
lines changed

6 files changed

+60
-55
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
##2.2.0
2+
- [#47] Tooling updates to VS2017
3+
14
##2.1.2
25
- [#43](https://github.com/serilog/serilog-sinks-splunk/pull/43) - Extend sink & static configuration to allow for custom JSON formatter.
36

sample/Program.cs renamed to sample/Sample/Program.cs

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
using System.Linq;
2-
using System.Threading;
32
using Serilog;
4-
using Serilog.Core;
53

64
namespace Sample
75
{
8-
///
9-
/// Sample 10 false
10-
///
116
public class Program
127
{
138
public static string EventCollectorToken = "2B94855F-1184-46F7-BFF1-56A3112F627E";
14-
9+
1510
public static void Main(string[] args)
1611
{
1712
var eventsToCreate = 100;
1813
var runSSL = false;
19-
20-
if(args.Length > 0)
21-
eventsToCreate = int.Parse(args[0]);
22-
23-
if(args.Length == 2)
24-
runSSL = bool.Parse(args[1]);
14+
15+
if (args.Length > 0)
16+
eventsToCreate = int.Parse(args[0]);
17+
18+
if (args.Length == 2)
19+
runSSL = bool.Parse(args[1]);
2520

2621
Log.Information("Sample starting up");
2722
Serilog.Debugging.SelfLog.Enable(System.Console.Out);
@@ -33,9 +28,9 @@ public static void Main(string[] args)
3328
OverridingHost(eventsToCreate);
3429
WithNoTemplate(eventsToCreate);
3530

36-
if(runSSL)
31+
if (runSSL)
3732
UsingSSL(eventsToCreate);
38-
33+
3934
Log.Debug("Done");
4035
}
4136

@@ -44,15 +39,15 @@ public static void OverridingSource(int eventsToCreate)
4439
// Override Source
4540
Log.Logger = new LoggerConfiguration()
4641
.MinimumLevel.Debug()
47-
.WriteTo.LiterateConsole()
42+
.WriteTo.LiterateConsole()
4843
.WriteTo.EventCollector(
49-
"http://localhost:8088",
44+
"http://localhost:8088",
5045
Program.EventCollectorToken,
5146
source: "Serilog.Sinks.Splunk.Sample.TestSource")
5247
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
5348
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Source Override")
5449
.CreateLogger();
55-
50+
5651
foreach (var i in Enumerable.Range(0, eventsToCreate))
5752
{
5853
Log.Information("Running source override loop {Counter}", i);
@@ -67,15 +62,15 @@ public static void OverridingSourceType(int eventsToCreate)
6762
// Override Source
6863
Log.Logger = new LoggerConfiguration()
6964
.MinimumLevel.Debug()
70-
.WriteTo.LiterateConsole()
65+
.WriteTo.LiterateConsole()
7166
.WriteTo.EventCollector(
72-
"http://localhost:8088",
67+
"http://localhost:8088",
7368
Program.EventCollectorToken,
7469
sourceType: "Serilog.Sinks.Splunk.Sample.TestSourceType")
7570
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
7671
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Source Type Override")
7772
.CreateLogger();
78-
73+
7974
foreach (var i in Enumerable.Range(0, eventsToCreate))
8075
{
8176
Log.Information("Running source type override loop {Counter}", i);
@@ -90,15 +85,15 @@ public static void OverridingHost(int eventsToCreate)
9085
// Override Host
9186
Log.Logger = new LoggerConfiguration()
9287
.MinimumLevel.Debug()
93-
.WriteTo.LiterateConsole()
88+
.WriteTo.LiterateConsole()
9489
.WriteTo.EventCollector(
95-
"http://localhost:8088",
90+
"http://localhost:8088",
9691
Program.EventCollectorToken,
9792
host: "myamazingmachine")
9893
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
9994
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Host Override")
10095
.CreateLogger();
101-
96+
10297
foreach (var i in Enumerable.Range(0, eventsToCreate))
10398
{
10499
Log.Information("Running host override loop {Counter}", i);
@@ -113,7 +108,7 @@ public static void UsingFullUri(int eventsToCreate)
113108
// Vanilla Test with full uri specified
114109
Log.Logger = new LoggerConfiguration()
115110
.MinimumLevel.Debug()
116-
.WriteTo.LiterateConsole()
111+
.WriteTo.LiterateConsole()
117112
.WriteTo.EventCollector(
118113
"http://localhost:8088/services/collector",
119114
Program.EventCollectorToken)
@@ -135,13 +130,13 @@ public static void UsingHostOnly(int eventsToCreate)
135130
// Vanilla Tests just host
136131
Log.Logger = new LoggerConfiguration()
137132
.MinimumLevel.Debug()
138-
.WriteTo.LiterateConsole()
133+
.WriteTo.LiterateConsole()
139134
.WriteTo.EventCollector(
140135
"http://localhost:8088",
141136
Program.EventCollectorToken)
142137
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
143138
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "Vanilla No services/collector in uri")
144-
.CreateLogger();
139+
.CreateLogger();
145140

146141
foreach (var i in Enumerable.Range(0, eventsToCreate))
147142
{
@@ -156,15 +151,15 @@ public static void WithNoTemplate(int eventsToCreate)
156151
// No Template
157152
Log.Logger = new LoggerConfiguration()
158153
.MinimumLevel.Debug()
159-
.WriteTo.LiterateConsole()
154+
.WriteTo.LiterateConsole()
160155
.WriteTo.EventCollector(
161-
"http://localhost:8088",
156+
"http://localhost:8088",
162157
Program.EventCollectorToken,
163158
renderTemplate: false)
164159
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
165160
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "No Templates")
166161
.CreateLogger();
167-
162+
168163
foreach (var i in Enumerable.Range(0, eventsToCreate))
169164
{
170165
Log.Information("Running no template loop {Counter}", i);
@@ -178,14 +173,14 @@ public static void UsingSSL(int eventsToCreate)
178173
// SSL
179174
Log.Logger = new LoggerConfiguration()
180175
.MinimumLevel.Debug()
181-
.WriteTo.LiterateConsole()
176+
.WriteTo.LiterateConsole()
182177
.WriteTo.EventCollector(
183178
"https://localhost:8088",
184179
Program.EventCollectorToken)
185180
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample", "ViaEventCollector")
186181
.Enrich.WithProperty("Serilog.Sinks.Splunk.Sample.TestType", "HTTPS")
187-
.CreateLogger();
188-
182+
.CreateLogger();
183+
189184
foreach (var i in Enumerable.Range(0, eventsToCreate))
190185
{
191186
Log.Information("HTTPS {Counter}", i);

sample/Sample/Sample.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp1.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Serilog" Version="2.4.0" />
10+
<PackageReference Include="Serilog.Sinks.Literate" Version="2.1.0" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\..\src\Serilog.Sinks.Splunk\Serilog.Sinks.Splunk.csproj" />
15+
</ItemGroup>
16+
17+
</Project>

sample/project.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

serilog-sinks-splunk.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{B9B13339-749C-4098-8845-780ED4FA488A}"
99
ProjectSection(SolutionItems) = preProject
1010
Build.ps1 = Build.ps1
11+
build.sh = build.sh
1112
CHANGES.md = CHANGES.md
1213
README.md = README.md
1314
assets\Serilog.snk = assets\Serilog.snk
@@ -23,6 +24,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Splunk", "src
2324
EndProject
2425
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Splunk.Tests", "test\Serilog.Sinks.Splunk.Tests\Serilog.Sinks.Splunk.Tests.csproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}"
2526
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "sample\Sample\Sample.csproj", "{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B}"
28+
EndProject
2629
Global
2730
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2831
Debug|Any CPU = Debug|Any CPU
@@ -37,12 +40,17 @@ Global
3740
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.Build.0 = Debug|Any CPU
3841
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.ActiveCfg = Release|Any CPU
3942
{3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44+
{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
45+
{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B}.Release|Any CPU.Build.0 = Release|Any CPU
4047
EndGlobalSection
4148
GlobalSection(SolutionProperties) = preSolution
4249
HideSolutionNode = FALSE
4350
EndGlobalSection
4451
GlobalSection(NestedProjects) = preSolution
4552
{32CF915C-3ECD-496C-8FDB-1214581274A6} = {7A774CBB-A6E9-4854-B4DB-4CF860B0C1C5}
4653
{3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {B9451AD8-09B9-4C09-A152-FBAE24806614}
54+
{4A4E361D-8BBE-4DDD-9E6C-53960C2B5F5B} = {1C75E4A9-4CB1-497C-AD17-B438882051A1}
4755
EndGlobalSection
4856
EndGlobal

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-splunk</PackageProjectUrl>
1414
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
1515
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
16+
<Version>2.2.0</Version>
1617
</PropertyGroup>
1718

18-
<ItemGroup>
19-
<PackageReference Include="Serilog" Version="2.3.0" />
20-
</ItemGroup>
21-
2219
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
2320
<PackageReference Include="Splunk.Logging.Common" Version="1.6.0" />
2421
<Reference Include="System.Net.Http" />
@@ -38,4 +35,8 @@
3835
<PackageReference Include="System.Net.Http" Version="4.1.1" />
3936
</ItemGroup>
4037

38+
<ItemGroup>
39+
<PackageReference Include="Serilog" Version="2.4.0" />
40+
</ItemGroup>
41+
4142
</Project>

0 commit comments

Comments
 (0)