Skip to content

Commit bdc2d4d

Browse files
Update README with NotepadWindow usage example
1 parent 2d00027 commit bdc2d4d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ To configure the Notepad sink and include the `SourceContext` in the output, cha
149149
}
150150
```
151151

152+
## Debugging and Diagnostics
153+
154+
When Serilog is not behaving as you expect, this may be caused by an internal exception or configuration issue. Serilog writes simple diagnostic messages to [SelfLog](https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics#selflog), which can be forwarded to Notepad, using the `NotepadWindow` static class:
155+
156+
```csharp
157+
Serilog.Debugging.SelfLog.Enable(s => NotepadWindow.WriteLine($"Internal Error with Serilog: {s}"));
158+
```
159+
160+
The above will attempt to write Serilog's diagnostic messages to the most recent Notepad process open in the user's session.
161+
152162
## Release History
153163

154164
Click on the [Releases](https://github.com/augustoproiete/serilog-sinks-notepad/releases) tab on GitHub.

0 commit comments

Comments
 (0)