internal void FailoverWrite(LoggerExceptionWithCapturedContext ctx) { // Format: var sb = new StringBuilder(); sb.Append("Actual:"); sb.Append(nl); sb.Append(IndentString(1)); Format(ctx.Actual, sb, 1); sb.Append(nl); sb.Append(IndentString(1)); sb.Append("Symptom:"); Format(ctx.Symptom, sb, 1); string output = sb.ToString(); FailoverWriteString(output); }
/// <summary> /// Write the exception to the database. /// </summary> /// <returns></returns> public async Task<ILogIdentifier> Write(ExceptionWithCapturedContext thrown) { try { return await WriteDatabase(thrown); } catch (Exception ourEx) { var actual = new ExceptionWithCapturedContext(ourEx, isHandled: true); var report = new LoggerExceptionWithCapturedContext(actual, thrown); FailoverWrite(report); return (ILogIdentifier)null; } }