Skip to content

Commit

Permalink
Release 2.2.0 built and published
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Barber committed Aug 30, 2018
1 parent cfe6302 commit 86a15d8
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 53 deletions.
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Then configure the SplunkHttpEventCollector with `ServerUrl` and `Token`:
includeEventProperties="true"
includeMdlc="false"
includePositionalParameters="false"
IgnoreSslErrors="false"
ServicePointManagerProtocols="Ssl3,Tls,Tls11,Tls12">
IgnoreSslErrors="false">
<contextproperty name="host" layout="${machinename}" />
<contextproperty name="threadid" layout="${threadid}" />
<contextproperty name="logger" layout="${logger}" />
Expand Down
Binary file added releases/NLog.Targets.Splunk.2.2.0.nupkg
Binary file not shown.
Binary file added releases/NLog.Targets.Splunk.2.2.0.symbols.nupkg
Binary file not shown.
2 changes: 1 addition & 1 deletion src/AspNetCoreWebApp/AspNetCoreWebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
<PackageReference Include="NLog" Version="4.5.8" />
<PackageReference Include="NLog" Version="4.5.9" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.6.0" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/AspNetCoreWebApp/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
Channel="bff36dda-e0fc-4cdd-b2dc-50418ee98ead"
RetriesOnError="0"
IgnoreSslErrors="true"
ServicePointManagerProtocols="Ssl3,Tls,Tls11,Tls12"
layout="${message} ${exception:format=tostring}"
includeEventProperties="true"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/ConsoleTestApp/ConsoleTestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.8\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.5.9\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
1 change: 0 additions & 1 deletion src/ConsoleTestApp/NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
Channel="bff36dda-e0fc-4cdd-b2dc-50418ee98ead"
RetriesOnError="0"
IgnoreSslErrors="true"
ServicePointManagerProtocols="Ssl3,Tls,Tls11,Tls12"
layout="${message} ${exception:format=tostring}"
includeEventProperties="true"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/ConsoleTestApp/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net462" />
<package id="NLog" version="4.5.8" targetFramework="net462" />
<package id="NLog" version="4.5.9" targetFramework="net462" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.8\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.5.9\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand All @@ -56,7 +56,8 @@
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.2\lib\net35\xunit.abstractions.dll</HintPath>
<HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.4.0.4049, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.4.0\lib\netstandard2.0\xunit.assert.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public SplunkHttpEventCollectorTests()
splunkHttpEventCollector.ServerUrl = new Uri("http://localhost:8088");
splunkHttpEventCollector.Token = "bff36dda-e0fc-4cdd-b2dc-50418ee98ead";
splunkHttpEventCollector.Channel = "bff36dda-e0fc-4cdd-b2dc-50418ee98ead";
splunkHttpEventCollector.ServicePointManagerProtocols = "Ssl3,Tls,Tls11,Tls12";
splunkHttpEventCollector.RetriesOnError = 0;

// Step 4. Define rules
Expand Down
4 changes: 2 additions & 2 deletions src/NLog.Targets.Splunk.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net462" />
<package id="NLog" version="4.5.8" targetFramework="net462" />
<package id="NLog" version="4.5.9" targetFramework="net462" />
<package id="xunit" version="2.4.0" targetFramework="net462" />
<package id="xunit.abstractions" version="2.0.2" targetFramework="net462" />
<package id="xunit.abstractions" version="2.0.3" targetFramework="net462" />
<package id="xunit.analyzers" version="0.10.0" targetFramework="net462" />
<package id="xunit.assert" version="2.4.0" targetFramework="net462" />
<package id="xunit.core" version="2.4.0" targetFramework="net462" />
Expand Down
12 changes: 4 additions & 8 deletions src/NLog.Targets.Splunk/NLog.Targets.Splunk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
<PackageLicenseUrl>https://github.com/AlanBarber/NLog.Targets.Splunk/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/AlanBarber/NLog.Targets.Splunk</RepositoryUrl>
<Version>2.2.0-rc01</Version>
<PackageReleaseNotes>
Version 2.2.0-rc01
- Updated NLog version from 4.5.6 to 4.5.8
<Version>2.2.0</Version>
<PackageReleaseNotes>Version 2.2.0
- Updated NLog version from 4.5.6 to 4.5.9
- Added support for Splunk HEC Data channel by David Matz (https://github.com/davidmatz)
- Adding new optional property 'ServicePointManagerProtocols' to configure used protocols for ServicePointManager.SecurityProtocol
Version 2.1.0
- Updated NLog version from 4.5.3 to 4.5.6
- Adding 'IgnoreSslErrors' property to config to allow for using Splunk with self signed certs
Expand All @@ -28,8 +26,6 @@ Version 2.1.0
- Speical thanks to Rolf Kristensen (https://github.com/snakefoot) for help with this release!
Version 2.0.0
- Updated to support .Net Standard 2.0 and .Net 4.5 w/ NLog 4.5.3
Version 2.0.0-rc
- Updated to .NET Standard 2.0 with NLog 4.5.0-rc07
Version 1.0.0
- Code cleanup and performance improvements
Verison 0.0.1
Expand All @@ -39,7 +35,7 @@ Verison 0.0.1
<!--common NuGet package refs -->
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="NLog" Version="4.5.8" />
<PackageReference Include="NLog" Version="4.5.9" />
</ItemGroup>

<!--.NET Standard 2.0 config -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,22 @@ public enum SendMode
/// <param name="batchSizeBytes">Batch max size.</param>
/// <param name="batchSizeCount">Max number of individual events in batch.</param>
/// <param name="ignoreSslErrors">Server validation callback should always return true</param>
/// <param name="ServicePointManagerProtocols">The service point manager protocols.</param>
/// <param name="middleware">HTTP client middleware. This allows to plug an HttpClient handler that
/// intercepts logging HTTP traffic.</param>
/// <param name="formatter">The formatter.</param>
/// <remarks>
/// Zero values for the batching params mean that batching is off.
/// </remarks>
public HttpEventCollectorSender(
Uri uri, string token, string channel, HttpEventCollectorEventInfo.Metadata metadata,
Uri uri,
string token,
string channel,
HttpEventCollectorEventInfo.Metadata metadata,
SendMode sendMode,
int batchInterval, int batchSizeBytes, int batchSizeCount, bool ignoreSslErrors,
string ServicePointManagerProtocols,
int batchInterval,
int batchSizeBytes,
int batchSizeCount,
bool ignoreSslErrors,
HttpEventCollectorMiddleware middleware,
HttpEventCollectorFormatter formatter = null)
{
Expand Down Expand Up @@ -220,23 +224,6 @@ public HttpEventCollectorSender(
httpClient = new HttpClient();
}

// setup override for ssl/tls settings
if (!string.IsNullOrWhiteSpace(ServicePointManagerProtocols))
{
NLog.Common.InternalLogger.Debug("Setting valid security protocols - Current: '{0}', Requested: '{1}'", ServicePointManager.SecurityProtocol,ServicePointManagerProtocols);
// Remove all protocols
ServicePointManager.SecurityProtocol = 0;
// parse the list of requested protocols
var requestedProtocols = ServicePointManagerProtocols.Replace(" ","").Split(',');
foreach (var requestedProtocol in requestedProtocols)
{
if (Enum.TryParse(requestedProtocol.Trim(), out SecurityProtocolType securityProtocolType))
{
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | securityProtocolType;
}
}
}

// setup splunk header token
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(AuthorizationHeaderScheme, token);

Expand Down
12 changes: 0 additions & 12 deletions src/NLog.Targets.Splunk/SplunkHttpEventCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,6 @@ public sealed class SplunkHttpEventCollector : TargetWithContext
/// </value>
public bool IgnoreSslErrors { get; set; }

/// <summary>
/// Sets the requested SSL/TLS protocols to support with the service point manager.
/// https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.securityprotocol(v=vs.110).aspx
/// Valid values include "Ssl3,Tls,Tls11,Tls12"
/// WARNING: This affects the entire app domain and not just the splunk HEC, beware of unintended consequences
/// </summary>
/// <value>
/// The service point manager protocols.
/// </value>
public string ServicePointManagerProtocols { get; set; }

/// <summary>
/// Configuration of additional properties to include with each LogEvent (Ex. ${logger}, ${machinename}, ${threadid} etc.)
/// </summary>
Expand Down Expand Up @@ -147,7 +136,6 @@ protected override void InitializeTarget()
BatchSizeBytes, // BatchSizeBytes - Set to 0 to disable
BatchSizeCount, // BatchSizeCount - Set to 0 to disable
IgnoreSslErrors, // Enable Ssl Error ignore for self singed certs *BOOL*
ServicePointManagerProtocols, // Ssl protocol connection types allowed (Ssl3,Tls,Tls11,Tls12)
new HttpEventCollectorResendMiddleware(RetriesOnError).Plugin // Resend Middleware with retry
);
_hecSender.OnError += (e) => { InternalLogger.Error(e, "SplunkHttpEventCollector(Name={0}): Failed to send LogEvents", Name); };
Expand Down

0 comments on commit 86a15d8

Please sign in to comment.