Skip to content

Commit df44782

Browse files
authored
More comments
1 parent ddb885e commit df44782

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Serilog.Extensions.Hosting/SerilogHostBuilderExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ namespace Serilog
2626
/// </summary>
2727
public static class SerilogHostBuilderExtensions
2828
{
29-
// Used internally to pass information through the container.
29+
// Used internally to pass information through the container. We need to do this because if `logger` is the
30+
// root logger, registering it as a singleton may lead to disposal along with the container by MEDI. This isn't
31+
// always desirable, i.e. we may be handed a logger and `dispose: false`, so wrapping it keeps us in control
32+
// of when the logger is disposed.
3033
class RegisteredLogger
3134
{
3235
public RegisteredLogger(ILogger logger)

0 commit comments

Comments
 (0)