Skip to content

Commit

Permalink
exceptionProcessorForFrameWorkDependentServices
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhamedyarov committed Sep 23, 2024
1 parent ddd3f7b commit 0e82a94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<ProjectReference Include="..\Mindbox.ExceptionsHandling.Abstractions\Mindbox.ExceptionsHandling.Abstractions.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Sentry.AspNetCore" Version="4.10.2" />
<PackageReference Include="Sentry.Extensions.Logging" Version="4.10.2" />
<PackageReference Include="Sentry.AspNetCore" Version="3.29.1" />
<PackageReference Include="Sentry.Extensions.Logging" Version="3.29.1" />
<PackageReference Include="Sentry.NLog" Version="3.29.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Mindbox.ExceptionsHandling.Template/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Mindbox.ExceptionsHandling.Template;

public record SentryOptions
internal record SentryOptions
{
public const string SectionName = "Sentry";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using Microsoft.Extensions.Options;
using Sentry;
using Sentry.AspNetCore;
using Sentry.Extensions.Logging;
using Sentry.NLog;

namespace Mindbox.ExceptionsHandling.Template;

internal class SentryOptionsConfiguration : IConfigureOptions<SentryAspNetCoreOptions>, IConfigureOptions<SentryLoggingOptions>
internal class SentryOptionsConfiguration : IConfigureOptions<SentryAspNetCoreOptions>, IConfigureOptions<SentryLoggingOptions>,
IConfigureNamedOptions<SentryNLogOptions>
{
private readonly SentryExceptionsCategoryProcessor _categoryProcessor;

Expand All @@ -23,4 +26,14 @@ public void Configure(SentryLoggingOptions options)
{
options.AddEventProcessor(_categoryProcessor);
}

public void Configure(SentryNLogOptions options)
{
Configure("autobugsSentry_wrapped", options);
}

public void Configure(string? name, SentryNLogOptions options)
{
options.AddEventProcessor(_categoryProcessor);
}
}

0 comments on commit 0e82a94

Please sign in to comment.