diff --git a/Src/CoreConsoleApp/CoreConsoleApp.csproj b/Src/CoreConsoleApp/CoreConsoleApp.csproj
index 8e8002e..ebe8247 100644
--- a/Src/CoreConsoleApp/CoreConsoleApp.csproj
+++ b/Src/CoreConsoleApp/CoreConsoleApp.csproj
@@ -21,11 +21,11 @@
-
+
-
-
-
+
+
+
diff --git a/Src/CoreWebApp/CoreWebApp.csproj b/Src/CoreWebApp/CoreWebApp.csproj
index 7b25013..7392d38 100644
--- a/Src/CoreWebApp/CoreWebApp.csproj
+++ b/Src/CoreWebApp/CoreWebApp.csproj
@@ -36,8 +36,8 @@
-
-
+
+
diff --git a/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj b/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj
index 0d9afb2..9267109 100644
--- a/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj
+++ b/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj
@@ -3,7 +3,7 @@
NLog.Targets.Stackify
2.0.0
- netstandard1.3;net40;net45
+ netstandard1.5;net40;net45
NLog.Targets.Stackify
NLog.Targets.Stackify
stackify;errors;logs
@@ -27,8 +27,8 @@
-
-
+
+
diff --git a/Src/NLog.Targets.Stackify/StackifyTarget.cs b/Src/NLog.Targets.Stackify/StackifyTarget.cs
index 2374ad7..0e8d07e 100644
--- a/Src/NLog.Targets.Stackify/StackifyTarget.cs
+++ b/Src/NLog.Targets.Stackify/StackifyTarget.cs
@@ -7,9 +7,6 @@
#if NET45 || NET40
using System.Runtime.Remoting.Messaging;
#endif
-using System.Security;
-using System.Text;
-using System.Threading.Tasks;
using StackifyLib;
using System.Diagnostics;
using StackifyLib.Internal.Logs;
@@ -31,6 +28,8 @@ public class StackifyTarget : TargetWithLayout
public string callContextKeys { get; set; }
public bool? logMethodNames { get; set; }
public bool? logAllParams { get; set; }
+ public bool? logAllProperties { get; set; }
+ public bool? logLastParameter { get; set; }
private List _GlobalContextKeys = new List();
private List _MappedContextKeys = new List();
@@ -99,17 +98,13 @@ protected override void Write(LogEventInfo logEvent)
{
StackifyAPILogger.Log(ex.ToString());
}
-
}
private Dictionary GetDiagnosticContextProperties()
{
-
-
Dictionary properties = new Dictionary();
-
string ndc = NLog.NestedDiagnosticsContext.TopMessage;
if (!String.IsNullOrEmpty(ndc))
@@ -117,14 +112,12 @@ private Dictionary GetDiagnosticContextProperties()
properties["ndc"] = ndc;
}
-
if (!_HasContextKeys)
{
return properties;
}
// GlobalDiagnosticsContext
-
foreach (string gdcKey in _GlobalContextKeys)
{
if (NLog.GlobalDiagnosticsContext.Contains(gdcKey))
@@ -137,8 +130,8 @@ private Dictionary GetDiagnosticContextProperties()
}
}
}
- // MappedDiagnosticsContext
+ // MappedDiagnosticsContext
foreach (string mdcKey in _MappedContextKeys)
{
if (NLog.MappedDiagnosticsContext.Contains(mdcKey))
@@ -170,7 +163,6 @@ private Dictionary GetDiagnosticContextProperties()
internal LogMsg Translate(LogEventInfo loggingEvent)
{
-
if (loggingEvent == null)
return null;
@@ -180,14 +172,11 @@ internal LogMsg Translate(LogEventInfo loggingEvent)
StackifyLib.Models.LogMsg msg = new LogMsg();
-
if (loggingEvent.Level != null)
{
msg.Level = loggingEvent.Level.Name;
}
-
-
if (loggingEvent.HasStackTrace && loggingEvent.UserStackFrame != null)
{
var frame = loggingEvent.UserStackFrame;
@@ -201,10 +190,8 @@ internal LogMsg Translate(LogEventInfo loggingEvent)
msg.SrcLine = frame.GetFileLineNumber();
}
}
-
}
-
//if it wasn't set above for some reason we will do it this way as a fallback
if (string.IsNullOrEmpty(msg.SrcMethod))
{
@@ -240,47 +227,33 @@ internal LogMsg Translate(LogEventInfo loggingEvent)
msg.Msg = (formattedMessage ?? "").Trim();
object debugObject = null;
- Dictionary args = new Dictionary();
- if ((loggingEvent.Parameters != null) && (loggingEvent.Parameters.Length > 0))
+ if ((logAllProperties ?? true) && loggingEvent.Properties.Count > 0)
{
-
- for (int i = 0; i < loggingEvent.Parameters.Length; i++)
+ Dictionary args = new Dictionary();
+ foreach (KeyValuePair