Skip to content
mganchas edited this page Sep 21, 2018 · 1 revision

This app will allow you to track the logging made by any application that uses Serilog, in a more efficient way than scrolling through gigantic text files.

Step-by-step guide

Log producer:

Add "Serilog", "Serilog.Sinks.Http" and "Serilog.Sinks.Network" NuGets to your producing project. Add the mentioned sinks to a using clause in the config file.

"Using": [ "Serilog", "Serilog.Enrichers.Environment", "Serilog.Enrichers.Process", "Serilog.Sinks.Http ", "Serilog.Sinks.Network" ] Add the writeTo instruction for the desired communication protocol (HTTP, TCP or UDP) to the config file. See examples below for each one.

{ "Name": "Logger", "Args": { "configureLogger": { "Name": "Http", "WriteTo": [ { "Name": "Http", "Args": { "Name": "Http", //"restrictedToMinimumLevel": "Information", "requestUri": "http://localhost:12345", "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.ffffff zzz} [{Level:u3}] {SourceContext}: {Message} {Exception}" } } ] } } }, { "Name": "TCPSink", "Args": { "uri": "tcp://127.0.0.1:12344", "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.ffffff zzz} [{Level:u3}] {SourceContext}: {Message} {Exception}" } }, { "Name": "UDPSink", "Args": { "uri": "127.0.0.1", "port": "12343", "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.ffffff zzz} [{Level:u3}] {SourceContext}: {Message} {Exception}" } }

Alternatively, you can create them directly on your project's code. Check following links for more details on this topic: https://github.com/FantasticFiasco/serilog-sinks-http/wiki/HTTP-sink https://github.com/pauldambra/Serilog.Sinks.Network

LogViewer:

Select the component type, it's unique name (it can be whatever you deem fit) and the path it points to (for a generated file this will be its full path, for the other options it'll be the ip and port). Alternatively, you can drag and drop a text file directly to the application and it'll add a file component with the file's name as its component name.

Start listener/reader execution with either play button: The green one will save all the read contents on your computer's temporary folder, creating a Realm database for each component; The blue one will save all the read content on your computer's memory; Why? Because, in terms of speed, memory saving will always be faster. If you just want to read a small file or listen (using any of the protocols available) to a low log producing application, then this will probably be your best choice. To any other case, I'd advise using the disk saving option.

You can stop the execution at any given time, using the stop button (only visible when executing).

You can filter the visible messages using the level filters available to each component or using the filter text box: If not running, you'll need to press the ENTER key to apply the filter - this prevents key pressing filter, which is slower); The ESCAPE key will clear the text box and reset the filter applied.

If you double-click on an entry's message, a popup window will appear, showing you that entry's details (pressing ESCAPE will close it).

At the bottom, there are options available that apply to all the listed components (start execution, stop the execution, clear the read data, reset the component list).

To remove a component, just right-click on its sidebar entry and click on "Remove".

External links https://realm.io/docs/dotnet/latest/

Clone this wiki locally