Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ builder.LogStartAttempt();
AssemblyRegistry.Add(typeof(Program).Assembly);

builder
.AddPandaVault()
.ConfigureWithPandaVault()
.AddSerilog()
.AddResponseCrafter(NamingConvention.ToSnakeCase)
.AddOpenApi()
Expand Down
2 changes: 1 addition & 1 deletion Shared.Kernel.Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
AssemblyRegistry.Add(typeof(Program).Assembly);

builder
// .AddPandaVault()
// .ConfigureWithPandaVault()
.AddSerilog()
.AddResponseCrafter(NamingConvention.ToSnakeCase)
.AddOpenApi()
Expand Down
1 change: 1 addition & 0 deletions src/SharedKernel/Extensions/HealthCheckExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class HealthCheckExtensions
public static WebApplication EnsureHealthy(this WebApplication app)
{
var healthCheckService = app.Services.GetRequiredService<HealthCheckService>();

var report = healthCheckService.CheckHealthAsync()
.Result;

Expand Down
6 changes: 3 additions & 3 deletions src/SharedKernel/Extensions/PandaVaultExtension.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Microsoft.AspNetCore.Builder;
using PandaVaultClient;
using PandaVaultClient.Extensions;

namespace SharedKernel.Extensions;

public static class PandaVaultExtension
{
public static WebApplicationBuilder AddPandaVault(this WebApplicationBuilder builder)
public static WebApplicationBuilder ConfigureWithPandaVault(this WebApplicationBuilder builder)
{
if (!builder.Environment.IsLocal())
{
builder.Configuration.AddPandaVault();
builder.AddPandaVault();
}

return builder;
Expand Down
12 changes: 11 additions & 1 deletion src/SharedKernel/Logging/SerilogExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ private static LoggerConfiguration FilterOutUnwantedLogs(this LoggerConfiguratio
.Filter
.ByExcluding(logEvent => logEvent.ShouldExcludeOutboxDbCommandLogs())
.Filter
.ByExcluding(logEvent => logEvent.ShouldExcludeSwaggerLogs());
.ByExcluding(logEvent => logEvent.ShouldExcludeSwaggerLogs())
.Filter
.ByExcluding(logEvent => logEvent.ShouldExcludeMassTransitHealthCheckLogs());
return loggerConfig;
}

Expand Down Expand Up @@ -105,6 +107,14 @@ private static bool ShouldExcludeSwaggerLogs(this LogEvent logEvent)
?.ToString()
?.Contains("/swagger") == true;
}

private static bool ShouldExcludeMassTransitHealthCheckLogs(this LogEvent logEvent)
{
var message = logEvent.RenderMessage();
return message.Contains("Health check masstransit-bus")
&& message.Contains("Unhealthy")
&& message.Contains("Not ready: not started");
}

private static string GetLogsPath(this WebApplicationBuilder builder)
{
Expand Down
8 changes: 4 additions & 4 deletions src/SharedKernel/SharedKernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Authors>Pandatech</Authors>
<Copyright>MIT</Copyright>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
<PackageId>Pandatech.SharedKernel</PackageId>
<Title>Pandatech Shared Kernel Library</Title>
<PackageTags>Pandatech, shared kernel, library, OpenAPI, Swagger, utilities, scalar</PackageTags>
Expand All @@ -29,7 +29,7 @@
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Prometheus.Metrics" Version="8.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.12.2" />
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.12.3" />
<PackageReference Include="FluentDateTime" Version="3.0.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="HtmlSanitizer" Version="8.1.870" />
Expand All @@ -48,10 +48,10 @@
<PackageReference Include="Pandatech.Crypto" Version="4.1.0" />
<PackageReference Include="Pandatech.DistributedCache" Version="3.0.1" />
<PackageReference Include="Pandatech.FluentMinimalApiMapper" Version="2.0.1" />
<PackageReference Include="Pandatech.PandaVaultClient" Version="4.0.0" />
<PackageReference Include="Pandatech.PandaVaultClient" Version="4.0.3" />
<PackageReference Include="Pandatech.RegexBox" Version="3.0.0" />
<PackageReference Include="Pandatech.ResponseCrafter" Version="5.0.2" />
<PackageReference Include="Scalar.AspNetCore" Version="1.2.44" />
<PackageReference Include="Scalar.AspNetCore" Version="1.2.45" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.1.0" />
</ItemGroup>
Expand Down