You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A [Serilog](https://serilog.net) sink that writes log events to Notepad (_Yes, you've read it right!_). The default output is plain text; JSON formatting can be plugged in using a package such as [_Serilog.Formatting.Compact_](https://github.com/serilog/serilog-formatting-compact).
3
+
A [Serilog](https://serilog.net) sink that writes log events to Notepad (_Yes, you've read it right!_). Simply open Notepad and immediately start receiving logs from your application, without even touching the filesystem.
4
4
5
5

6
6
7
+
`Serilog.Sinks.Notepad` writes messages to the most recent `notepad.exe` started on current user's session, by default. This behavior can be changed in the sink configuration.
8
+
9
+
The default output is plain text; JSON formatting can be plugged in using a package such as [_Serilog.Formatting.Compact_](https://github.com/serilog/serilog-formatting-compact).
10
+
7
11
## Give a Star! :star:
8
12
9
13
If you like or are using this project please give it a star. Thanks!
@@ -24,17 +28,19 @@ Log.Logger = new LoggerConfiguration()
24
28
.CreateLogger();
25
29
26
30
Log.Information("Hello, world!");
31
+
32
+
Log.CloseAndFlush();
27
33
```
28
34
29
-
Open Notepad, and you should see the logs appear in that Notepad window. By default, `Serilog.Sinks.Notepad` writes messages to the most recent `notepad.exe` started on the machine. This behavior can be changed in the sink configuration.
35
+
Open Notepad, and you should see the logs appear in that Notepad window you've just opened. By default, `Serilog.Sinks.Notepad` writes messages to the most recent `notepad.exe` started by the user. This behavior can be changed in the sink configuration.
30
36
31
37
## Background
32
38
33
39
I created this sink just for fun, after reading [this comment on Reddit](https://www.reddit.com/r/programming/comments/gnazif/ray_tracing_in_notepadexe_at_30_fps/fr8uy2l/):
34
40
35
-

41
+
[](https://www.reddit.com/r/programming/comments/gnazif/ray_tracing_in_notepadexe_at_30_fps/fr8uy2l/)
36
42
37
-
I thought that's a clever idea to be able to simply open a Notepad instance and immediately start receiving logs from your application, and I can imagine this actually being useful for troubleshooting issues with applications.
43
+
I thought it was a clever idea to be able to simply open a Notepad instance and immediately start receiving logs from your application, and I can imagine this actually being useful for troubleshooting issues with applications.
38
44
39
45
## Configuration
40
46
@@ -133,10 +139,10 @@ To configure the Notepad sink and include the `SourceContext` in the output, cha
0 commit comments