fixed LogLock.cs for Linux Path Compatibility

This commit is contained in:
Simon 2019-09-23 21:53:44 +08:00
parent 660fa596ce
commit e2c1c2faac

View File

@ -33,12 +33,12 @@ namespace Blog.Core.Common.LogHelper
// 因进入与退出写入模式应在同一个try finally语句块内所以在请求进入写入模式之前不能触发异常否则释放次数大于请求次数将会触发异常
LogWriteLock.EnterWriteLock();
var path = contentRoot + @"\Log";
var path = Path.Combine(contentRoot, "Log");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string logFilePath = path + $@"\{filename}.log";
string logFilePath = Path.Combine(path, $@"{filename}.log");
var now = DateTime.Now;
var logContent = (