Skip to content

Commit 673e0b2

Browse files
committed
add documentation
1 parent 553e47f commit 673e0b2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ The repository makes use of continuous integration (CI) on [AppVeyor](https://ci
3434

3535
## Good to know
3636

37-
### TraceSource logging
37+
### Logging
3838

39-
The Debug build of SSH.NET contains rudimentary logging functionality via `System.Diagnostics.TraceSource`. See `Renci.SshNet.Abstractions.DiagnosticAbstraction` for usage examples.
39+
The tests always log to the console. See the [Logging documentation](https://sshnet.github.io/SSH.NET/logging.html) on how to set a custom `ILoggerFactory`.
4040

4141
### Wireshark
4242

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The main types provided by this library are:
6262
## Additional Documentation
6363

6464
* [Further examples](https://sshnet.github.io/SSH.NET/examples.html)
65+
* [Logging](https://sshnet.github.io/SSH.NET/logging.html)
6566
* [API browser](https://sshnet.github.io/SSH.NET/api/Renci.SshNet.html)
6667

6768
## Encryption Methods

docfx/logging.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Logging
2+
=================
3+
4+
SSH.NET uses the `Microsoft.Extensions.Logging` API to log diagnostic messages. In order to access the log messages of SSH.NET in your own application for diagnosis, simply register your own `ILoggerFactory` before using the SSH.NET APIs with the following code:
5+
6+
```cs
7+
SshNetLoggingConfiguration.InitializeLogging(loggerFactory);
8+
```
9+
10+
All messages by SSH.NET are logged under the `Renci.SshNet` category.

0 commit comments

Comments
 (0)