Skip to content

Commit

Permalink
Added InternalLogger for connection attempt. Bumped to NLog 4.5
Browse files Browse the repository at this point in the history
Signed-off-by: Rolf Kristensen <sweaty1@hotmail.com>
  • Loading branch information
snakefoot committed Jun 19, 2021
1 parent d0e932a commit f07ff4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/NLog.Targets.Fluentd/Fluentd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
}
Expand Down
17 changes: 5 additions & 12 deletions src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net35;net40;net45;netstandard2.0</TargetFrameworks>
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' != 'netstandard2.0' ">true</DisableImplicitFrameworkReferences>

<Description>NLog Target that emits the log entries to a fluentd node</Description>
<Authors>Moriyoshi Koizumi</Authors>
Expand All @@ -18,22 +19,14 @@
<RepositoryUrl>git://github.com/fluent/NLog.Targets.Fluentd</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="4.5.0" />
<PackageReference Include="MsgPack.Cli" Version="0.9.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<Reference Include="System" />
<Reference Include="System.Core" />

<PackageReference Include="MsgPack.Cli" Version="0.8.0" />
<PackageReference Include="NLog" Version="2.1.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="MsgPack.Cli" Version="0.9.2" />
<PackageReference Include="NLog" Version="4.5.0-rc03" />
</ItemGroup>


</Project>

0 comments on commit f07ff4d

Please sign in to comment.