Skip to content

Commit 54878bd

Browse files
author
mwatson
committed
Updating to core
1 parent f8e241a commit 54878bd

22 files changed

+374
-198
lines changed

Src/StackifyLib.log4net/Fody.targets

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

Src/StackifyLib.log4net/FodyWeavers.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>7D98E5E3-A3E7-4613-8BB7-80A60D86A5E8</ProjectGuid>
11+
<RootNamespace>StackifyLib.log4net</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "1.0.0-*",
3+
4+
"dependencies": {
5+
"StackifyLib": "1.23.1-*"
6+
},
7+
8+
"frameworks": {
9+
//"netstandard1.3": {
10+
// "dependencies": {
11+
// "log4net": "2.0.5"
12+
// }
13+
//},
14+
"net40": {
15+
"dependencies": {
16+
"log4net": "2.0.3"
17+
}
18+
},
19+
"net45": {
20+
"dependencies": {
21+
"log4net": "2.0.3"
22+
}
23+
}
24+
}
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
8+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
9+
<PropertyGroup Label="Globals">
10+
<ProjectGuid>55cc4568-242f-40d7-9bd3-23c4f502c161</ProjectGuid>
11+
<RootNamespace>StackifyLib.NLog</RootNamespace>
12+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
13+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
14+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<SchemaVersion>2.0</SchemaVersion>
19+
</PropertyGroup>
20+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>

Src/StackifyLib.nLog/StackifyTarget.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
using System.Globalization;
55
using System.Linq;
66
using System.Reflection;
7+
#if NET45 || NET40
78
using System.Runtime.Remoting.Messaging;
9+
#endif
810
using System.Security;
911
using System.Text;
1012
using System.Threading.Tasks;
1113
using NLog;
1214
using NLog.Targets;
13-
using System.ComponentModel.DataAnnotations;
1415
using StackifyLib;
1516
using System.Diagnostics;
1617
using StackifyLib.Internal.Logs;
@@ -150,6 +151,7 @@ private Dictionary<string, object> GetDiagnosticContextProperties()
150151
}
151152
}
152153
}
154+
#if NET45 || NET40
153155

154156
foreach (string key in _CallContextKeys)
155157
{
@@ -160,7 +162,7 @@ private Dictionary<string, object> GetDiagnosticContextProperties()
160162
properties[key.ToLower()] = value;
161163
}
162164
}
163-
165+
#endif
164166
return properties;
165167

166168
}

Src/StackifyLib.nLog/project.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "1.23.1-beta2",
3+
4+
"title": "Stackify NLog",
5+
6+
"packOptions": {
7+
"owners": [ "stackify_matt", "jtaylorstackify" ],
8+
"tags": [ "stackify", "errors", "logs" ],
9+
"summary": "NLog target to send errors and logs to Stackify and Prefix"
10+
11+
},
12+
13+
"dependencies": {
14+
"StackifyLib": "1.23.1-beta2"
15+
},
16+
17+
"frameworks": {
18+
"netstandard1.3": {
19+
"dependencies": {
20+
"NLog": "4.4.0-beta13"
21+
}
22+
},
23+
"net40": {
24+
"dependencies": {
25+
"NLog": "4.0.1"
26+
}
27+
28+
},
29+
"net45": {
30+
"dependencies": {
31+
"NLog": "4.0.1"
32+
}
33+
34+
}
35+
}
36+
}

Src/StackifyLib/API.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace StackifyLib
1010
{
1111
public class API
1212
{
13-
private static Utils.StackifyHttpClient client;
13+
private static Utils.HttpClient client;
1414
static API()
1515
{
16-
client = new StackifyHttpClient(null, null);
16+
client = new HttpClient(null, null);
1717
}
1818

1919
public static Models.Device[] GetDeviceList()

Src/StackifyLib/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ internal static string Get(string key, string defaultValue = null)
106106
{
107107
if (key != null)
108108
{
109-
#if NET45
109+
#if NET45 || NET40
110110
v = System.Configuration.ConfigurationManager.AppSettings[key];
111111
#endif
112112
if (string.IsNullOrEmpty(v))

Src/StackifyLib/Internal/Logs/LogClient.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class LogClient : ILogClient
1616
{
1717
private static bool _ServicePointSet = false;
1818
private LogQueue _LogQueue = null;
19-
private StackifyHttpClient _HttpClient = null;
19+
private HttpClient _HttpClient = null;
2020

2121
private readonly ErrorGovernor governor = new ErrorGovernor();
2222

@@ -41,7 +41,7 @@ private void EnsureHttpClient()
4141
{
4242
if (_HttpClient == null)
4343
{
44-
_HttpClient = new StackifyHttpClient(_ApiKey, _ApiUrl);
44+
_HttpClient = new HttpClient(_ApiKey, _ApiUrl);
4545
}
4646
}
4747

@@ -274,7 +274,7 @@ private Models.LogMsgGroup CreateDefaultMsgGroup()
274274
}
275275

276276

277-
internal Task<StackifyHttpClient.StackifyWebResponse> SendLogsByGroups(LogMsg[] messages)
277+
internal Task<HttpClient.StackifyWebResponse> SendLogsByGroups(LogMsg[] messages)
278278
{
279279
try
280280
{
@@ -288,15 +288,15 @@ private Models.LogMsgGroup CreateDefaultMsgGroup()
288288

289289
if (_HttpClient.IsRecentError())
290290
{
291-
var tcs = new TaskCompletionSource<StackifyHttpClient.StackifyWebResponse>();
292-
tcs.SetResult(new StackifyHttpClient.StackifyWebResponse() { Exception = new Exception("Unable to send logs at this time due to recent error: " + (_HttpClient.LastErrorMessage ?? "")) });
291+
var tcs = new TaskCompletionSource<HttpClient.StackifyWebResponse>();
292+
tcs.SetResult(new HttpClient.StackifyWebResponse() { Exception = new Exception("Unable to send logs at this time due to recent error: " + (_HttpClient.LastErrorMessage ?? "")) });
293293
return tcs.Task;
294294
}
295295

296296
if (!identified)
297297
{
298-
var tcs = new TaskCompletionSource<StackifyHttpClient.StackifyWebResponse>();
299-
tcs.SetResult(new StackifyHttpClient.StackifyWebResponse() { Exception = new Exception("Unable to send logs at this time. Unable to identify app") });
298+
var tcs = new TaskCompletionSource<HttpClient.StackifyWebResponse>();
299+
tcs.SetResult(new HttpClient.StackifyWebResponse() { Exception = new Exception("Unable to send logs at this time. Unable to identify app") });
300300
return tcs.Task;
301301
}
302302

@@ -333,8 +333,8 @@ private Models.LogMsgGroup CreateDefaultMsgGroup()
333333
{
334334
Utils.StackifyAPILogger.Log(ex.ToString());
335335

336-
var tcs = new TaskCompletionSource<StackifyHttpClient.StackifyWebResponse>();
337-
tcs.SetResult(new StackifyHttpClient.StackifyWebResponse() { Exception = ex });
336+
var tcs = new TaskCompletionSource<HttpClient.StackifyWebResponse>();
337+
tcs.SetResult(new HttpClient.StackifyWebResponse() { Exception = ex });
338338
return tcs.Task;
339339
}
340340

0 commit comments

Comments
 (0)