Don't log api keys

This commit is contained in:
pcjones
2024-02-12 02:31:36 +01:00
parent 27ba8a1f19
commit 8df44d514f
2 changed files with 25 additions and 4 deletions

View File

@@ -31,7 +31,19 @@ internal class Program
builder.Services.AddMemoryCache(options =>
{
//options.SizeLimit = 20000;
});
});
// TODO workaround to not log api keys
builder.Logging.AddFilter((category, level) =>
{
// Prevent logging of HTTP request and response if the category is HttpClient
if (category.Contains("System.Net.Http.HttpClient"))
{
return false;
}
return true;
});
builder.Services.AddControllers();
builder.Services.AddHostedService<ArrSyncBackgroundService>();