Update ServiceMain.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run

This commit is contained in:
Namhyeon Go 2024-08-26 18:29:13 +09:00
parent 4e6b63df50
commit 7b7a25f5e9

View File

@ -397,9 +397,16 @@ namespace WelsonJS.Service
Console.WriteLine(_message);
}
using (StreamWriter writer = new StreamWriter(logFilePath, true))
try
{
writer.WriteLine(_message);
using (StreamWriter writer = new StreamWriter(logFilePath, true))
{
writer.WriteLine(_message);
}
}
catch (Exception ex)
{
Console.WriteLine($"Failed to write log: {ex.Message}");
}
}
}