Skip to content

Commit 98953f6

Browse files
committed
Added log4net .net core support and updated nlog
1 parent 40432c9 commit 98953f6

File tree

8 files changed

+39
-17
lines changed

8 files changed

+39
-17
lines changed

samples/Exceptionless.SampleConsole/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"Exceptionless": {
1515
"target": "project"
1616
},
17-
"Exceptionless.DateTimeExtensions": "3.2.55",
17+
"Exceptionless.DateTimeExtensions": "3.2.65",
1818
"Exceptionless.NLog": {
1919
"target": "project"
2020
},
21-
"Exceptionless.RandomData": "1.1.26",
21+
"Exceptionless.RandomData": "1.1.27",
2222
"Microsoft.NETCore.App": {
2323
"type": "platform",
2424
"version": "1.0.1"

src/Exceptionless/Extensions/EventBuilderExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using Exceptionless.Models.Data;
4+
5+
#if !PORTABLE && !NETSTANDARD1_2
46
using Exceptionless.Plugins.Default;
7+
#endif
58

69
namespace Exceptionless {
710
public static class EventBuilderExtensions {

src/Platforms/Exceptionless.Log4net.Signed/project.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"Exceptionless.Signed": {
2626
"target": "project"
2727
},
28-
"log4net": "2.0.5"
28+
"log4net": "2.0.7"
2929
},
3030
"buildOptions": {
3131
"compile": {
@@ -46,6 +46,11 @@
4646
"xmlDoc": true
4747
},
4848
"frameworks": {
49+
"netstandard1.3": {
50+
"buildOptions": {
51+
"define": [ "SIGNED", "NETSTANDARD", "NETSTANDARD1_3" ]
52+
}
53+
},
4954
"net45": {
5055
"buildOptions": {
5156
"define": [ "SIGNED", "NET45" ]

src/Platforms/Exceptionless.Log4net/Log4netExceptionlessLog.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Reflection;
23
using Exceptionless.Logging;
34
using log4net;
45

@@ -15,35 +16,43 @@ public void Error(string message, string source = null, Exception exception = nu
1516
if (LogLevel.Error < MinimumLogLevel)
1617
return;
1718

18-
LogManager.GetLogger(source ?? "Exceptionless").Error(message, exception);
19+
GetLogger(source).Error(message, exception);
1920
}
2021

2122
public void Info(string message, string source = null) {
2223
if (LogLevel.Info < MinimumLogLevel)
2324
return;
2425

25-
LogManager.GetLogger(source ?? "Exceptionless").Info(message);
26+
GetLogger(source).Info(message);
2627
}
2728

2829
public void Debug(string message, string source = null) {
2930
if (LogLevel.Debug < MinimumLogLevel)
3031
return;
3132

32-
LogManager.GetLogger(source ?? "Exceptionless").Debug(message);
33+
GetLogger(source).Debug(message);
3334
}
3435

3536
public void Warn(string message, string source = null) {
3637
if (LogLevel.Warn < MinimumLogLevel)
3738
return;
3839

39-
LogManager.GetLogger(source ?? "Exceptionless").Warn(message);
40+
GetLogger(source).Warn(message);
4041
}
4142

4243
public void Trace(string message, string source = null) {
4344
if (LogLevel.Trace < MinimumLogLevel)
4445
return;
4546

46-
LogManager.GetLogger(source ?? "Exceptionless").Debug(message);
47+
GetLogger(source).Debug(message);
48+
}
49+
50+
private ILog GetLogger(string name) {
51+
#if NETSTANDARD1_3
52+
return LogManager.GetLogger(typeof(Log4netExceptionlessLog).GetTypeInfo().Assembly, name ?? "Exceptionless");
53+
#else
54+
return LogManager.GetLogger(name ?? "Exceptionless");
55+
#endif
4756
}
4857

4958
public void Flush() { }

src/Platforms/Exceptionless.Log4net/project.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
},
2222
"dependencies": {
2323
"Exceptionless": {
24-
"target": "project"
24+
"target": "project"
2525
},
26-
"log4net": "2.0.5"
26+
"log4net": "2.0.7"
2727
},
2828
"buildOptions": {
29-
"compile": [ "**/*.cs", "../../GlobalAssemblyInfo.cs" ],
29+
"compile": [ "**/*.cs", "../../GlobalAssemblyInfo.cs" ],
3030
"nowarn": [
3131
"CS1591"
3232
],
@@ -35,6 +35,11 @@
3535
"xmlDoc": true
3636
},
3737
"frameworks": {
38+
"netstandard1.3": {
39+
"buildOptions": {
40+
"define": [ "NETSTANDARD", "NETSTANDARD1_3" ]
41+
}
42+
},
3843
"net45": {
3944
"buildOptions": {
4045
"define": [ "NET45" ]

src/Platforms/Exceptionless.NLog.Signed/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050
"define": [ "SIGNED", "NETSTANDARD", "NETSTANDARD1_3" ]
5151
},
5252
"dependencies": {
53-
"NLog": "4.4.0-betaV15"
53+
"NLog": "5.0.0-beta05"
5454
}
5555
},
5656
"net45": {
5757
"buildOptions": {
5858
"define": [ "SIGNED", "NET45" ]
5959
},
6060
"dependencies": {
61-
"NLog": "4.3.5"
61+
"NLog": "4.4.1"
6262
}
6363
}
6464
}

src/Platforms/Exceptionless.NLog/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"define": [ "NETSTANDARD", "NETSTANDARD1_3" ]
4141
},
4242
"dependencies": {
43-
"NLog": "4.4.0-betaV15"
43+
"NLog": "5.0.0-beta05"
4444
}
4545
},
4646
"net45": {
4747
"buildOptions": {
4848
"define": [ "NET45" ]
4949
},
5050
"dependencies": {
51-
"NLog": "4.3.11"
51+
"NLog": "4.4.1"
5252
}
5353
}
5454
}

tests/Exceptionless.Tests/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"xunit": "2.2.0-beta2-build3300",
1818
"xunit.extensibility.core": "2.2.0-beta2-build3300",
1919
"xunit.extensibility.execution": "2.2.0-beta2-build3300",
20-
"xunit.runner.visualstudio": "2.2.0-beta2-build1149",
21-
"Exceptionless.RandomData": "1.1.26"
20+
"xunit.runner.visualstudio": "2.2.0-beta2-build1149",
21+
"Exceptionless.RandomData": "1.1.27"
2222
},
2323
"frameworks": {
2424
//"netcoreapp1.0": {

0 commit comments

Comments
 (0)