Skip to content

Commit 429f750

Browse files
authored
Tweak logging.md (#1601)
1 parent 16d84d0 commit 429f750

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docfx/logging.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ Logging
44
SSH.NET uses the [Microsoft.Extensions.Logging](https://learn.microsoft.com/dotnet/core/extensions/logging) API to log diagnostic messages. In order to access the log messages of SSH.NET in your own application for diagnosis, register your own `ILoggerFactory` before using the SSH.NET APIs, for example:
55

66
```cs
7+
using Microsoft.Extensions.Logging;
8+
79
ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
810
{
911
builder.SetMinimumLevel(LogLevel.Debug);
1012
builder.AddConsole();
1113
});
1214

1315
Renci.SshNet.SshNetLoggingConfiguration.InitializeLogging(loggerFactory);
16+
```
1417

1518
All messages by SSH.NET are logged under the `Renci.SshNet` category.

0 commit comments

Comments
 (0)