Skip to content

Commit

Permalink
Upgraded to NLog 5 (#2697)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsandfoxes authored and vaind committed Oct 14, 2023
1 parent 4cb767d commit 67c0bd1
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ API Changes:
- ISpanContext was removed. Use ITraceContext instead. ([#2668](https://github.com/getsentry/sentry-dotnet/pull/2668))
- Removed IHasTransactionNameSource. Use ITransactionContext instead. ([#2654](https://github.com/getsentry/sentry-dotnet/pull/2654))
- Adding `Distribution` to `IEventLike` ([#2660](https://github.com/getsentry/sentry-dotnet/pull/2660))
- Upgraded to NLog version 5 ([#2697](https://github.com/getsentry/sentry-dotnet/pull/2697))
- Removed unused `StackFrame.InstructionOffset`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
- Change `StackFrame`'s `ImageAddress`, `InstructionAddress` and `FunctionId` to `long?`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
- Enable `CaptureFailedRequests` by default ([2688](https://github.com/getsentry/sentry-dotnet/pull/2688))
Expand Down
2 changes: 1 addition & 1 deletion samples/Sentry.Samples.NLog/Sentry.Samples.NLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="NLog" Version="5.2.4" />
<ProjectReference Include="..\..\src\Sentry.NLog\Sentry.NLog.csproj">
<Private>true</Private>
</ProjectReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.NLog/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static LoggingConfiguration AddSentry(

optionsConfig?.Invoke(options);

Target.Register<SentryTarget>("Sentry");
LogManager.Setup().SetupExtensions(e => e.RegisterTarget<SentryTarget>("Sentry"));

var target = new SentryTarget(options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.NLog/Sentry.NLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="4.5.11" />
<PackageReference Include="NLog" Version="5.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Sentry.NLog/SentryTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ internal SentryTarget(SentryNLogOptions options, Func<IHub> hubAccessor, IDispos
/// <summary>
/// Options for both the <see cref="SentryTarget"/> and the sentry sdk itself.
/// </summary>
[Advanced]
public SentryNLogOptions Options { get; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace Sentry.NLog
public bool InitializeSdk { get; set; }
public string MinimumBreadcrumbLevel { get; set; }
public string MinimumEventLevel { get; set; }
[NLog.Config.Advanced]
public Sentry.NLog.SentryNLogOptions Options { get; }
public NLog.Layouts.Layout? Release { get; set; }
public int ShutdownTimeoutSeconds { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace Sentry.NLog
public bool InitializeSdk { get; set; }
public string MinimumBreadcrumbLevel { get; set; }
public string MinimumEventLevel { get; set; }
[NLog.Config.Advanced]
public Sentry.NLog.SentryNLogOptions Options { get; }
public NLog.Layouts.Layout? Release { get; set; }
public int ShutdownTimeoutSeconds { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace Sentry.NLog
public bool InitializeSdk { get; set; }
public string MinimumBreadcrumbLevel { get; set; }
public string MinimumEventLevel { get; set; }
[NLog.Config.Advanced]
public Sentry.NLog.SentryNLogOptions Options { get; }
public NLog.Layouts.Layout? Release { get; set; }
public int ShutdownTimeoutSeconds { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace Sentry.NLog
public bool InitializeSdk { get; set; }
public string MinimumBreadcrumbLevel { get; set; }
public string MinimumEventLevel { get; set; }
[NLog.Config.Advanced]
public Sentry.NLog.SentryNLogOptions Options { get; }
public NLog.Layouts.Layout? Release { get; set; }
public int ShutdownTimeoutSeconds { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.NLog.Tests/ApiApprovalTests.verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Sentry.NLog.Tests;
[UsesVerify]
public class ApiApprovalTests
{
[Fact]
[SkippableFact]
public Task Run()
{
return typeof(SentryTarget).Assembly.CheckApproval();
Expand Down
4 changes: 2 additions & 2 deletions test/Sentry.NLog.Tests/IntegrationTests.verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[UsesVerify]
public class IntegrationTests
{
[Fact]
[SkippableFact]
public Task Simple()
{
var transport = new RecordingTransport();
Expand Down Expand Up @@ -60,7 +60,7 @@ public Task Simple()
.IgnoreStandardSentryMembers();
}

[Fact]
[SkippableFact]
public Task LoggingInsideTheContextOfLogging()
{
var transport = new RecordingTransport();
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.NLog.Tests/Sentry.NLog.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="NLog" Version="5.2.4" />
<ProjectReference Include="..\..\src\Sentry.NLog\Sentry.NLog.csproj" />
<ProjectReference Include="..\Sentry.Testing\Sentry.Testing.csproj" />

Expand Down

0 comments on commit 67c0bd1

Please sign in to comment.