🐛 修改了log文件夹

This commit is contained in:
liufei
2022-06-03 23:42:45 +08:00
parent e42f2c3c73
commit e46d64193b

View File

@@ -12,7 +12,10 @@ namespace GeekDesk.Util
try
{
Exception ex = exception as Exception;
if (!Directory.Exists(Constants.ERROR_FILE_PATH.Substring(0, Constants.ERROR_FILE_PATH.LastIndexOf("\\"))))
{
Directory.CreateDirectory(Constants.ERROR_FILE_PATH.Substring(0, Constants.ERROR_FILE_PATH.LastIndexOf("\\")));
}
using (FileStream fs = File.Open(Constants.ERROR_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
fs.Seek(0, SeekOrigin.End);
@@ -58,6 +61,10 @@ namespace GeekDesk.Util
{
try
{
if (!Directory.Exists(Constants.LOG_FILE_PATH.Substring(0, Constants.LOG_FILE_PATH.LastIndexOf("\\"))))
{
Directory.CreateDirectory(Constants.LOG_FILE_PATH.Substring(0, Constants.LOG_FILE_PATH.LastIndexOf("\\")));
}
using (FileStream fs = File.Open(Constants.LOG_FILE_PATH, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
fs.Seek(0, SeekOrigin.End);