Skip to content

AWSTarget updated to NLog v5.2.2 for build trimming #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions samples/NLog/ConfigExample/ConfigExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\NLog.AWS.Logger\NLog.AWS.Logger.csproj" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/AWS.Logger.Core/AWS.Logger.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EnableTrimAnalyzer Condition=" '$(TargetFramework)' == 'net8.0' ">true</EnableTrimAnalyzer>
<IsTrimmable Condition=" '$(TargetFramework)' == 'net8.0' ">true</IsTrimmable>

<Version>4.0.0</Version>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/NLog.AWS.Logger/AWSTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class AWSTarget : TargetWithLayout, IAWSLoggerConfig
/// </summary>
public AWSTarget()
{
this.OptimizeBufferReuse = true;
Copy link
Contributor

@GarrettBeatty GarrettBeatty Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the reason for this line change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptimizeBufferReuse was introduced in NLog v4 as opt-in optimization. With NLog v5 then it is always enabled, and the setting has been marked as obsolete.

}

/// <summary>
Expand Down
7 changes: 5 additions & 2 deletions src/NLog.AWS.Logger/NLog.AWS.Logger.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
Expand Down Expand Up @@ -26,6 +26,9 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

<EnableTrimAnalyzer Condition=" '$(TargetFramework)' == 'net8.0' ">true</EnableTrimAnalyzer>
<IsTrimmable Condition=" '$(TargetFramework)' == 'net8.0' ">true</IsTrimmable>

<Version>4.0.0</Version>
</PropertyGroup>
Expand All @@ -45,7 +48,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="4.5.0" />
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
Loading