This commit is contained in:
2024-04-27 11:10:01 +02:00
parent 1038a6fdee
commit 1a2838a796
6 changed files with 16 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ namespace EonaCat.Logger.Test.Web;
public static class Logger
{
private static LogManager LogManager;
public static ELogType MinLogType { get; set; }
public static ELogType MaxLogType { get; set; }
public static bool UseLocalTime { get; set; }
public static string LogFolder => Path.Combine(FileLoggerOptions.DefaultPath, "logs");
public static string CurrentLogFile => LogManager.CurrentLogFile;
@@ -98,7 +98,10 @@ public static class Logger
if (IsDisabled)
return;
LogManager.Write(exception, message, writeToConsole: writeToConsole);
if (ELogType.ERROR <= MaxLogType)
{
LogManager.Write(exception, message, writeToConsole: writeToConsole);
}
}
public static void Configure()
@@ -106,7 +109,7 @@ public static class Logger
var loggerSettings = new LoggerSettings
{
Id = "EonaCatTestLogger",
MinLogType = ELogType.INFO,
MaxLogType = ELogType.INFO,
UseLocalTime = UseLocalTime,
FileLoggerOptions =
{