mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.1 KiB
60 lines
2.1 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
#define LOG_ALL_IDENTITY_SERVER_NONE
|
|
|
|
using System;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Squidex.Config
|
|
{
|
|
public static class Logging
|
|
{
|
|
public static void AddFilters(this ILoggingBuilder builder)
|
|
{
|
|
builder.AddFilter((category, level) =>
|
|
{
|
|
if (category.StartsWith("Orleans.Runtime.NoOpHostEnvironmentStatistics", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Error;
|
|
}
|
|
|
|
if (category.StartsWith("Orleans.Runtime.SafeTimer", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Error;
|
|
}
|
|
|
|
if (category.StartsWith("Orleans.Runtime.Scheduler", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Warning;
|
|
}
|
|
|
|
if (category.StartsWith("Orleans.", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Warning;
|
|
}
|
|
|
|
if (category.StartsWith("Runtime.", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Warning;
|
|
}
|
|
|
|
if (category.StartsWith("Microsoft.AspNetCore.", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return level >= LogLevel.Warning;
|
|
}
|
|
#if LOG_ALL_IDENTITY_SERVER
|
|
if (category.StartsWith("IdentityServer4.", StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
return true;
|
|
}
|
|
#endif
|
|
return level >= LogLevel.Information;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|