Skip to content

Commit cb36e96

Browse files
committed
Fix xmldoc
1 parent 6f32cb4 commit cb36e96

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public void SetException(Exception exception)
6868
/// </summary>
6969
/// <param name="properties">The collected properties, or null if no collection is active.</param>
7070
/// <returns>True if properties could be collected.</returns>
71+
/// <seealso cref="IDiagnosticContext.Set"/>
7172
public bool TryComplete(out IEnumerable<LogEventProperty> properties)
7273
{
7374
lock (_propertiesLock)
@@ -81,21 +82,15 @@ public bool TryComplete(out IEnumerable<LogEventProperty> properties)
8182
}
8283

8384
/// <summary>
84-
/// Complete the context and retrieve the properties added to it, if any. This will
85+
/// Complete the context and retrieve the properties and exception added to it, if any. This will
8586
/// stop collection and remove the collector from the original execution context and
8687
/// any of its children.
8788
/// </summary>
8889
/// <param name="properties">The collected properties, or null if no collection is active.</param>
8990
/// <param name="exception">The collected exception, or null if none has been collected or if no collection is active.</param>
9091
/// <returns>True if properties could be collected.</returns>
91-
/// <example>
92-
/// This overload provides the exception collected by the diagnostic context, which is useful when unhandled exceptions are handled
93-
/// before reaching Serilog's RequestLoggingMiddleware. One example is using https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails to transform
94-
/// exceptions to ProblemDetails responses.
95-
/// </example>
96-
/// <remarks>
97-
/// If an unhandled exception reaches Serilog's RequestLoggingMiddleware, then the unhandled exception should take precedence.<br/>
98-
/// </remarks>
92+
/// <seealso cref="IDiagnosticContext.Set"/>
93+
/// <seealso cref="Serilog.IDiagnosticContext.SetException"/>
9994
public bool TryComplete(out IEnumerable<LogEventProperty> properties, out Exception exception)
10095
{
10196
lock (_propertiesLock)

src/Serilog.Extensions.Hosting/IDiagnosticContext.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ public interface IDiagnosticContext
3232
void Set(string propertyName, object value, bool destructureObjects = false);
3333

3434
/// <summary>
35-
/// Set an exception to include in the Serilog request log event.
35+
/// Set the specified exception on the current diagnostic context.
36+
/// <br/><br/>
37+
/// This is useful when unhandled exceptions do not reach Serilog.AspNetCore's RequestLoggingMiddleware,
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.
3640
/// </summary>
37-
/// <example>
38-
/// Passing an exception to the diagnostic context is useful when unhandled exceptions are handled before reaching Serilog's
39-
/// RequestLoggingMiddleware. One example is using https://www.nuget.org/packages/Hellang.Middleware.ProblemDetails to transform
40-
/// exceptions to ProblemDetails responses.
41-
/// </example>
4241
/// <remarks>
43-
/// If an unhandled exception reaches Serilog's RequestLoggingMiddleware, then the unhandled exception takes precedence.<br/>
4442
/// If <c>null</c> is given, it clears any previously assigned exception.
4543
/// </remarks>
4644
/// <param name="exception">The exception to log.</param>

0 commit comments

Comments
 (0)