fix: 首次启动无法创建日志文件夹;Config 使用了错误的锁

This commit is contained in:
龙腾猫跃 committed 2026-07-02 09:33:35 +08:00
1 parent 473ac94d63
commit d3b9ccde9c
2 files changed
+9 -7

No files matched your search

+3 -1
View File
@@ -323,7 +323,9 @@ public class FileLogger : BaseLogger, IDisposable {
Logger.Warn(ex, "整理日志文件失败");
}
// 新建 writer
writer = new StreamWriter(PathUtils.ForApi(Path.Combine(logFolder, $"{fileNamePrefix}1{fileNameSuffix}")), append: true) { AutoFlush = true };
string logFilePath = PathUtils.ForApi(Path.Combine(logFolder, $"{fileNamePrefix}1{fileNameSuffix}"));
DirectoryUtils.Create(logFolder);
writer = new StreamWriter(logFilePath, append: true) { AutoFlush = true };
}
/// <inheritdoc/>