mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Added Create Directory setting.
This commit is contained in:
parent
5731d6f351
commit
1a8d5ba0f2
5 changed files with 8 additions and 14 deletions
|
|
@ -68,9 +68,6 @@ namespace ServerManagerTool.DiscordBot.Services
|
|||
|
||||
if (LogManager.Configuration.FindTargetByName(loggerName) is null)
|
||||
{
|
||||
if (!Directory.Exists(logFilePath))
|
||||
Directory.CreateDirectory(logFilePath);
|
||||
|
||||
var logFile = new FileTarget(loggerName)
|
||||
{
|
||||
FileName = Path.Combine(logFilePath, $"{logName}.log"),
|
||||
|
|
@ -81,7 +78,8 @@ namespace ServerManagerTool.DiscordBot.Services
|
|||
ArchiveDateFormat = "yyyyMMdd",
|
||||
ArchiveOldFileOnStartup = true,
|
||||
MaxArchiveFiles = maxArchiveFiles,
|
||||
MaxArchiveDays = maxArchiveDays,
|
||||
MaxArchiveDays = maxArchiveDays,
|
||||
CreateDirs = true,
|
||||
};
|
||||
LogManager.Configuration.AddTarget(loggerName, logFile);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue