diff --git a/src/Files.Shared/FileLogger.cs b/src/Files.Shared/FileLogger.cs index 055732f558f6..1dde50a599f2 100644 --- a/src/Files.Shared/FileLogger.cs +++ b/src/Files.Shared/FileLogger.cs @@ -30,7 +30,8 @@ public void Log(LogLevel logLevel, EventId eventId, TState state, Except semaphoreSlim.Wait(); try { - File.AppendAllText(filePath, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.ffff}|{logLevel}|{formatter(state, exception)}" + Environment.NewLine); + var message = exception?.ToString() ?? formatter(state, exception); + File.AppendAllText(filePath, $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.ffff}|{logLevel}|{message}" + Environment.NewLine); } catch (Exception e) {