Create Log-Directory

This commit is contained in:
glax 2024-02-10 20:52:38 +01:00
parent 81e0080a62
commit 0dac5e72be
2 changed files with 2 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<Authors>Glax</Authors>
<RepositoryUrl>https://git.bernloehr.eu/glax/GlaxLogger</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.0.5</Version>
<Version>1.0.6</Version>
</PropertyGroup>
<ItemGroup>

View File

@ -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;