Skip to content

Commit

Permalink
Merge branch 'master' into Vs2017
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot committed Aug 24, 2024
2 parents 81f3209 + 33577ad commit ca0f0b7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 37 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ NLog.Targets.Fluents is a custom target of [NLog](https://github.com/nlog/NLog)
Settings
--------

Setting | Description | Example
--------------------------- | ----------------------------------------------------------- | --------------
Host | Host name of the fluentd node | example.local
Port | Port number of the fluentd node | 24224
Tag | Fluentd tag name | windowshost
NoDelay | Enable Nagle's algorithm | true
SendBufferSize | Send buffer size | 8192
SendTimeout | Send timeout | 2
LingerEnabled | Wait for all the data to be sent when closing the connection | false
LingerTime | Linger timeout | 2
EmitStackTraceWhenAvailable | Emit a stacktrace for every log entry when available | false
IncludeAllProperties | Include structured logging parameters for every log entry | false
Setting | Description | Example
--------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------
Host | Host name of the fluentd node | example.local
Port | Port number of the fluentd node | 24224
Tag | Fluentd tag name | windowshost
NoDelay | Enable Nagle's algorithm | true
SendBufferSize | Send buffer size | 8192
SendTimeout | Send timeout | 2
LingerEnabled | Wait for all the data to be sent when closing the connection | false
LingerTime | Linger timeout | 2
EmitStackTraceWhenAvailable | Emit a stacktrace for every log entry when available | false
IncludeAllProperties | Include structured logging parameters for every log entry | false
ExcludeProperties | Comma separated string with names which properties to exclude. Only used when IncludeAllProperties is *true*. | property1,property2


License
Expand Down
6 changes: 3 additions & 3 deletions src/Demo/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
12 changes: 9 additions & 3 deletions src/Demo/Demo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Demo</RootNamespace>
<AssemblyName>Demo</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -32,11 +33,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog">
<HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down
2 changes: 1 addition & 1 deletion src/Demo/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.5.0" targetFramework="net45" />
<package id="NLog" version="4.7.0" targetFramework="net48" />
</packages>
6 changes: 6 additions & 0 deletions src/NLog.Targets.Fluentd/Fluentd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ public class Fluentd : NLog.Targets.TargetWithLayout

public bool IncludeAllProperties { get; set; }

public ISet<string> ExcludeProperties { get; set; }

private TcpClient client;

private Stream stream;
Expand Down Expand Up @@ -319,6 +321,9 @@ protected override void Write(LogEventInfo logEvent)
if (string.IsNullOrEmpty(propertyKey))
continue;

if (ExcludeProperties.Contains(propertyKey))
continue;

record[propertyKey] = SerializePropertyValue(propertyKey, property.Value);
}
}
Expand Down Expand Up @@ -369,6 +374,7 @@ public Fluentd()
this.LingerTime = 1000;
this.EmitStackTraceWhenAvailable = false;
this.Tag = "${processname}";
this.ExcludeProperties = new HashSet<string>();
}
}
}
33 changes: 15 additions & 18 deletions src/NLog.Targets.Fluentd/NLog.Targets.Fluentd.csproj
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

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

<Description>NLog Target that emits the log entries to a fluentd node</Description>
<Authors>Moriyoshi Koizumi</Authors>
<Authors>Moriyoshi Koizumi, Jarred Capellman</Authors>
<CurrentYear>$([System.DateTime]::Now.ToString(yyyy))</CurrentYear>
<Copyright>Copyright (c) $(CurrentYear) - Moriyoshi Koizumi</Copyright>
<Copyright>Copyright (c) 2020 - Moriyoshi Koizumi and Jarred Capellman</Copyright>

<Version>1.0.6.0</Version>

<Version>1.0.5.0</Version>

<PackageTags>NLog;fluentd;log;logging</PackageTags>
<PackageIconUrl>http://nlog-project.org/N.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/fluent/NLog.Targets.Fluentd</PackageProjectUrl>
<PackageProjectUrl>https://github.com/jcapellman/NLog.Targets.Fluentd</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/fluent/NLog.Targets.Fluentd/master/LICENSE.txt</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/fluent/NLog.Targets.Fluentd</RepositoryUrl>
<RepositoryUrl>git://github.com/jcapellman/NLog.Targets.Fluentd</RepositoryUrl>
<PackageReleaseNotes>Add exclude properties property</PackageReleaseNotes>
<PackageId>NLog.Targets.Fluentd.NetStandard</PackageId>
<Product>NLog.Targets.Fluentd.NetStandard</Product>
<Company>Moriyoshi Koizumi, Jarred Capellman</Company>
</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="1.0.1" />
<PackageReference Include="NLog" Version="4.7.0" />
</ItemGroup>

</Project>
</Project>

0 comments on commit ca0f0b7

Please sign in to comment.