mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2024-09-20 23:48:27 +08:00
fixed LogLock.cs for Linux Path Compatibility
This commit is contained in:
parent
660fa596ce
commit
e2c1c2faac
|
@ -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 = (
|
||||
|
|
Loading…
Reference in New Issue
Block a user