'Can I use some viewer to review and search for serilog logging files?
I'm aware of some free/commercial visualizer of structured logging, like seq, retrace. The problem is I don't want to directly add as sinks, because I don't want every single logging action to involve sending out an Http request to the log server. Instead, I'd like to log to local files as quickly as possible, while still have the ability to review and search the logged file content in a structured way.
So is there a practical solution to this? Thanks.
Solution 1:[1]
One option is to write the files using the file sink and Serilog.Formatting.Compact:
.WriteTo.File(new CompactJsonFormatter(), "log.clef")
You can then use something like jq or clef-tool to read/query the logs, including structured data:
clef -i log.clef --filter="SomeProp > 100"
where SomeProp > 100 is a Serilog filter expression.
Solution 2:[2]
I've used this tool for Serilog: https://github.com/warrenbuckley/Compact-Log-Format-Viewer
It does work nice, I miss some features but this tool can also visualize the structured data of ie. serilog-files.
Solution 3:[3]
I have been using Analogy Log Viewer from Lior Banai for the last year or so and it works great for Serilog (especially the Json Visualizer view).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Markus Knappen Johansson |
| Solution 3 | VoÄko |
