From 0dac5e72be478415e7b10b443fda4fb0c9fb06a0 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 10 Feb 2024 20:52:38 +0100 Subject: [PATCH] Create Log-Directory --- GlaxLogger/GlaxLogger.csproj | 2 +- GlaxLogger/Logger.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GlaxLogger/GlaxLogger.csproj b/GlaxLogger/GlaxLogger.csproj index b8dfc0e..57e0b38 100644 --- a/GlaxLogger/GlaxLogger.csproj +++ b/GlaxLogger/GlaxLogger.csproj @@ -7,7 +7,7 @@ Glax https://git.bernloehr.eu/glax/GlaxLogger git - 1.0.5 + 1.0.6 diff --git a/GlaxLogger/Logger.cs b/GlaxLogger/Logger.cs index 3290387..30aa495 100644 --- a/GlaxLogger/Logger.cs +++ b/GlaxLogger/Logger.cs @@ -15,6 +15,7 @@ public class Logger : ILogger, IDisposable, IAsyncDisposable { this._filterLevel = filteredLevel; string logFolderPath = outputFolderPath ?? Path.Join(Environment.CurrentDirectory, "logs"); + Directory.CreateDirectory(logFolderPath); this._filteredLogfile = new FileStream(Path.Join(logFolderPath, $"{DateTime.Now:yyyy-MM-dd HH.mm.ss}-filtered.log"), FileMode.Create); this._allMessageLogfile = new FileStream(Path.Join(logFolderPath, $"{DateTime.Now:yyyy-MM-dd HH.mm.ss}.log"), FileMode.Create); this._consoleOut = consoleOut ?? Console.Out;