Skip to content

Commit 7d5552c

Browse files
authored
Merge pull request #48 from splunk/develop
1.7.2 release
2 parents c7e8a7a + 3fd410f commit 7d5552c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+247
-625
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Splunk logging for .NET
22

3-
#### Version 1.7.1
3+
#### Version 1.7.2
44

55
Splunk logging for .NET enables you to configure [HTTP Event Collector](http://dev.splunk.com/view/event-collector/SP-CAAAE6M), UDP or TCP
66
logging of events to a Splunk Enterprise instance from within your .NET
@@ -26,8 +26,8 @@ more in-depth information be sure to visit [Splunk logging for
2626

2727
Here's what you need to use Splunk logging for .NET:
2828

29-
* **.NET Framework 4.0 or later**: Splunk logging for .NET
30-
requires the .NET Framework version 4.0 or later.
29+
* **.NET Framework 4.5 or later**: Splunk logging for .NET
30+
requires the .NET Framework version 4.5 or later.
3131
* **Splunk Enterprise** or **Splunk Cloud**: If you haven't already installed Splunk Enterprise,
3232
download it at [http://www.splunk.com/download](http://www.splunk.com/download). Otherwise, you
3333
should have at least a trial subscription to [Splunk Cloud](http://www.splunkcloud.com).
@@ -39,7 +39,7 @@ need:
3939
[xUnit.net Test Support](https://resharper-plugins.jetbrains.com/packages/xunitcontrib/).
4040
Otherwise, install the [xUnit.net runner for Visual Studio 2012 and 2013](http://visualstudiogallery.msdn.microsoft.com/463c5987-f82b-46c8-a97e-b1cde42b9099).
4141
* **Visual Studio**: Splunk logging for .NET supports
42-
development in [Microsoft Visual Studio 2012 or later](http://www.microsoft.com/visualstudio/downloads).
42+
development in [Microsoft Visual Studio 2017 or later](http://www.microsoft.com/visualstudio/downloads).
4343

4444
### Install
4545

Splunk.Logging.sln

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5142E63D-CF4A-48EA-8527-F6B2DB4718C0}"
77
EndProject
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splunk.Logging.Common", "sr
2525
EndProject
2626
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "standalone-test", "standalone-test\standalone-test.csproj", "{027FFE79-69FE-4A69-8B71-7364F9D1D99B}"
2727
EndProject
28+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "examples", "examples\examples.csproj", "{05F10C76-EB18-4413-98DA-B62A574E1D9B}"
29+
EndProject
2830
Global
2931
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3032
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +53,10 @@ Global
5153
{027FFE79-69FE-4A69-8B71-7364F9D1D99B}.Debug|Any CPU.Build.0 = Debug|Any CPU
5254
{027FFE79-69FE-4A69-8B71-7364F9D1D99B}.Release|Any CPU.ActiveCfg = Release|Any CPU
5355
{027FFE79-69FE-4A69-8B71-7364F9D1D99B}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{05F10C76-EB18-4413-98DA-B62A574E1D9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{05F10C76-EB18-4413-98DA-B62A574E1D9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{05F10C76-EB18-4413-98DA-B62A574E1D9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{05F10C76-EB18-4413-98DA-B62A574E1D9B}.Release|Any CPU.Build.0 = Release|Any CPU
5460
EndGlobalSection
5561
GlobalSection(SolutionProperties) = preSolution
5662
HideSolutionNode = FALSE
@@ -62,4 +68,7 @@ Global
6268
{B776A5C5-A301-472E-9D21-A62306358B2C} = {5142E63D-CF4A-48EA-8527-F6B2DB4718C0}
6369
{027FFE79-69FE-4A69-8B71-7364F9D1D99B} = {2F34BC99-9753-46CC-A386-33B543EFF916}
6470
EndGlobalSection
71+
GlobalSection(ExtensibilityGlobals) = postSolution
72+
SolutionGuid = {94C12565-E78F-448C-95F0-D0D0EACAE996}
73+
EndGlobalSection
6574
EndGlobal

appveyor.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: "{build}"
22

3+
image:
4+
- Visual Studio 2017
5+
6+
37
# Make sure we always have RDP details
48
init:
59
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
@@ -14,6 +18,7 @@ environment:
1418
SPLUNK_BUILD: 8c86330ac18
1519
SDK_APP_VERSION: 1.0.0
1620

21+
VisualStudioVersion: 15.0
1722

1823
install:
1924
# Download Splunk and the SDK App
@@ -51,6 +56,7 @@ build:
5156
configuration:
5257
- Release
5358

54-
test_script:
55-
# Run the unit tests and acceptance tests
56-
- ps: xunit.console.clr4.x86 test\unit-tests\bin\Release\unit-tests.dll /appveyor
59+
# test_script:
60+
# test will be automatically discovered
61+
# # Run the unit tests and acceptance tests
62+
# - ps: xunit.console.clr4.x86 test\unit-tests\bin\Debug\unit-tests.dll /appveyor
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<configuration>
3-
<runtime>
4-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5-
<dependentAssembly>
6-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7-
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
8-
</dependentAssembly>
9-
</assemblyBinding>
10-
</runtime>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5+
</startup>
6+
<runtime>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
1114
</configuration>

examples/Program.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Splunk.Logging;
2+
using System;
3+
using System.Diagnostics;
4+
5+
namespace examples
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
EnableSelfSignedCertificates();
12+
13+
TraceListenerExample();
14+
}
15+
16+
private static void TraceListenerExample()
17+
{
18+
// Replace with your HEC token
19+
string token = "1ff51387-405a-4566-9f6a-87bc3fb44424";
20+
21+
// TraceListener
22+
var trace = new TraceSource("demo-logger");
23+
trace.Switch.Level = SourceLevels.All;
24+
var listener = new HttpEventCollectorTraceListener(
25+
uri: new Uri("https://127.0.0.1:8088"),
26+
token: token,
27+
batchSizeCount: 1);
28+
trace.Listeners.Add(listener);
29+
30+
// Send some events
31+
trace.TraceEvent(TraceEventType.Error, 0, "hello world 0");
32+
trace.TraceEvent(TraceEventType.Information, 1, "hello world 1");
33+
trace.TraceData(TraceEventType.Information, 2, "hello world 2");
34+
trace.TraceData(TraceEventType.Error, 3, "hello world 3");
35+
trace.TraceData(TraceEventType.Information, 4, "hello world 4");
36+
trace.Close();
37+
38+
// Now search splunk index that used by your HEC token you should see above 5 events are indexed
39+
}
40+
41+
private static void EnableSelfSignedCertificates()
42+
{
43+
// Enable self signed certificates
44+
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
45+
delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
46+
System.Security.Cryptography.X509Certificates.X509Chain chain,
47+
System.Net.Security.SslPolicyErrors sslPolicyErrors)
48+
{
49+
return true;
50+
};
51+
}
52+
}
53+
}

test/unit-tests/Properties/AssemblyInfo.cs renamed to examples/Properties/AssemblyInfo.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
5+
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
8-
[assembly: AssemblyTitle("unit-tests")]
8+
[assembly: AssemblyTitle("examples")]
99
[assembly: AssemblyDescription("")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
12-
[assembly: AssemblyProduct("unit-tests")]
13-
[assembly: AssemblyCopyright("Copyright © 2015")]
12+
[assembly: AssemblyProduct("examples")]
13+
[assembly: AssemblyCopyright("Copyright © 2019")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
1919
// COM, set the ComVisible attribute to true on that type.
2020
[assembly: ComVisible(false)]
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("e5255b09-464b-4eca-b766-a7cfa0a00474")]
23+
[assembly: Guid("05f10c76-eb18-4413-98da-b62a574e1d9b")]
2424

2525
// Version information for an assembly consists of the following four values:
2626
//
2727
// Major Version
28-
// Minor Version
28+
// Minor Version
2929
// Build Number
3030
// Revision
3131
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
32+
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.5.0.0")]
36-
[assembly: AssemblyFileVersion("1.5.0.0")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

examples/examples.csproj

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{05F10C76-EB18-4413-98DA-B62A574E1D9B}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>examples</RootNamespace>
10+
<AssemblyName>examples</AssemblyName>
11+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<Deterministic>true</Deterministic>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="Microsoft.CSharp" />
37+
</ItemGroup>
38+
<ItemGroup>
39+
<Compile Include="Program.cs" />
40+
<Compile Include="Properties\AssemblyInfo.cs" />
41+
</ItemGroup>
42+
<ItemGroup>
43+
<None Include="App.config" />
44+
<None Include="packages.config" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<ProjectReference Include="..\src\Splunk.Logging.Common\Splunk.Logging.Common.csproj">
48+
<Project>{b776a5c5-a301-472e-9d21-a62306358b2c}</Project>
49+
<Name>Splunk.Logging.Common</Name>
50+
</ProjectReference>
51+
<ProjectReference Include="..\src\Splunk.Logging.TraceListener\Splunk.Logging.TraceListener.csproj">
52+
<Project>{17f12964-d0c9-41a9-9dee-a4a5a52b24ae}</Project>
53+
<Name>Splunk.Logging.TraceListener</Name>
54+
</ProjectReference>
55+
</ItemGroup>
56+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
</Project>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<packages>
3-
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
4-
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="EnterpriseLibrary.SemanticLogging" version="2.0.1406.1" targetFramework="net45" />
4+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
55
</packages>

packages/repositories.config

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

packages/xunit.runner.visualstudio.2.0.0-rc1-build1030/build/net20/xunit.runner.visualstudio.props

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

packages/xunit.runner.visualstudio.2.0.0-rc1-build1030/build/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid/xunit.runner.visualstudio.props

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

packages/xunit.runner.visualstudio.2.0.0-rc1-build1030/build/win8/xunit.runner.visualstudio.props

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

packages/xunit.runner.visualstudio.2.0.0-rc1-build1030/build/win8/xunit.runner.visualstudio.targets

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

0 commit comments

Comments
 (0)