Skip to content

Commit f13731a

Browse files
committed
Fix xmldoc, add ObsoleteAttribute
1 parent 668132a commit f13731a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Serilog.Extensions.Hosting/Extensions/Hosting/DiagnosticContextCollector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void AddOrUpdate(LogEventProperty property)
4040
}
4141

4242
/// <summary>
43-
/// Set an exception to include in the Serilog request log event.
43+
/// Set the exception associated with the current diagnostic context.
4444
/// </summary>
4545
/// <example>
4646
/// Passing an exception to the diagnostic context is useful when unhandled exceptions are handled before reaching Serilog's
@@ -69,6 +69,7 @@ public void SetException(Exception exception)
6969
/// <param name="properties">The collected properties, or null if no collection is active.</param>
7070
/// <returns>True if properties could be collected.</returns>
7171
/// <seealso cref="IDiagnosticContext.Set"/>
72+
[Obsolete("Replaced by TryComplete(out IEnumerable<LogEventProperty> properties, out Exception exception).")]
7273
public bool TryComplete(out IEnumerable<LogEventProperty> properties)
7374
{
7475
return TryComplete(out properties, out _);

src/Serilog.Extensions.Hosting/IDiagnosticContext.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ public interface IDiagnosticContext
3333

3434
/// <summary>
3535
/// Set the specified exception on the current diagnostic context.
36-
/// <br/><br/>
37-
/// This is useful when unhandled exceptions do not reach <c>Serilog.AspNetCore.RequestLoggingMiddleware</c>,
38-
/// such as when using <a href="https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails">Hellang.Middleware.ProblemDetails</a>
39-
/// to transform exceptions to ProblemDetails responses.
4036
/// </summary>
4137
/// <remarks>
42-
/// If <c>null</c> is given, it clears any previously assigned exception.
38+
/// This method is useful when unhandled exceptions do not reach <c>Serilog.AspNetCore.RequestLoggingMiddleware</c>,
39+
/// such as when using <a href="https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails">Hellang.Middleware.ProblemDetails</a>
40+
/// to transform exceptions to ProblemDetails responses.
4341
/// </remarks>
44-
/// <param name="exception">The exception to log.</param>
42+
/// <param name="exception">The exception to log. If <c>null</c> is given, it clears any previously assigned exception.</param>
4543
void SetException(Exception exception);
4644
}
4745
}

0 commit comments

Comments
 (0)