Files
mixtape/Finch/Logging/LogLevelOverrides.cs
T

35 lines
968 B
C#

using System.Reflection;
using Microsoft.Extensions.Logging;
namespace Finch.Logging;
public class LogLevelOverrides : Dictionary<string, LogLevel>
{
public LogLevelOverrides()//IHostEnvironment env)
{
this["Finch"] = LogLevel.Debug;
this["Finch.Routing"] = LogLevel.Debug;
// if (env.IsDevelopment())
// {
// this["Finch"] = LogLevel.Debug;
// this["Finch.Routing"] = LogLevel.Debug;
// }
// else
// {
// this["Finch"] = LogLevel.Debug;
// }
this["SixLabors"] = LogLevel.Warning;
this["Quartz"] = LogLevel.Warning;
this["Microsoft.AspNetCore"] = LogLevel.Warning;
this["System.Net.Http.HttpClient"] = LogLevel.Warning;
this["Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager"] = LogLevel.Error;
string entryAssemblyName = Assembly.GetEntryAssembly()?.GetName().Name;
if (entryAssemblyName != null)
{
this[entryAssemblyName] = LogLevel.Debug;
}
}
}