diff --git a/.vs/NLog.Targets.Fluentd/v16/.suo b/.vs/NLog.Targets.Fluentd/v16/.suo new file mode 100644 index 0000000..c4489d1 Binary files /dev/null and b/.vs/NLog.Targets.Fluentd/v16/.suo differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..384fcf6 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/src/NLog.Targets.Fluentd/Fluentd.cs b/src/NLog.Targets.Fluentd/Fluentd.cs index bdb56fc..0355ebf 100644 --- a/src/NLog.Targets.Fluentd/Fluentd.cs +++ b/src/NLog.Targets.Fluentd/Fluentd.cs @@ -121,7 +121,7 @@ protected void UnpackTo(Unpacker unpacker, IList array, long arrayLength } } - public void UnpackTo(Unpacker unpacker, IDictionary collection) + public new void UnpackTo(Unpacker unpacker, IDictionary collection) { long mapLength; if (!unpacker.ReadMapLength(out mapLength)) @@ -143,7 +143,7 @@ protected override IDictionary UnpackFromCore(Unpacker unpacker) return retval; } - public void UnpackTo(Unpacker unpacker, object collection) + public new void UnpackTo(Unpacker unpacker, object collection) { var dictionary = collection as IDictionary; if (dictionary == null) @@ -246,6 +246,7 @@ protected void EnsureConnected() private void ConnectClient() { + NLog.Common.InternalLogger.Debug("Fluentd Connecting to {0}:{1}", this.Host, this.Port); this.client.Connect(this.Host, this.Port); this.stream = this.client.GetStream(); this.emitter = new FluentdEmitter(this.stream); @@ -309,7 +310,7 @@ protected override void Write(LogEventInfo logEvent) } record.Add("stacktrace", transcodedFrames); } - if (this.IncludeAllProperties && logEvent.Properties.Count > 0) + if (this.IncludeAllProperties && logEvent.HasProperties) { foreach (var property in logEvent.Properties) { @@ -344,7 +345,7 @@ protected override void Write(LogEventInfo logEvent) private static object SerializePropertyValue(string propertyKey, object propertyValue) { - if (propertyValue == null || Convert.GetTypeCode(propertyValue) != TypeCode.Object || propertyValue is decimal) + if (propertyValue == null || Convert.GetTypeCode(propertyValue) != TypeCode.Object) { return propertyValue; // immutable } diff --git a/src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj b/src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj index 1ad2a36..e954b0c 100644 --- a/src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj +++ b/src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj @@ -2,6 +2,7 @@ net35;net40;net45;netstandard2.0 + true NLog Target that emits the log entries to a fluentd node Moriyoshi Koizumi @@ -18,22 +19,14 @@ git://github.com/fluent/NLog.Targets.Fluentd - - true - + + + + - - - - - - - - -