Serilog is a .NET logging framework that writes log events in a structured, queryable manner.
Seq is a http receiver for Serilog. There are plenty of other built-in receivers, called
"Sinks", for Serilog so you can
write logs to a file, console, database...in any combination. Seq is just one of the receivers, there are
plenty of others you can plug into it.
The beauty of Seq is that it can give you a real-time feed of your log events in a localhost page. Have a look at the screenshots at
http://getseq.net/ and also
http://nblumhardt.com/ <== he wrote it ...read some words too if you have time.
The beauty of Serilog is the
structured event data. The screenshots in the links above will show you what I mean by that. My "wow" moment came when I grokked the whole structured, queryable aspect of it.
Seq is free for a single user, you only need paid license if you deploy to multi-user multi-tier environments where you need API keys to manage traffic.
Serilog is
on Github and is free.
I found it very easy to install and get up and running, just install Seq and add the Serilog Nuget package to your Visual Studio solution and you're right to go.
Here's a snippet of code that will make little sense out of context but it's an illustration of structured logging....
if (cableNumberAttribute == null)
{
if (!OffSheetBlocksWithNoCableAttribute.Contains(block.Name))
{
Log.Warning("{DwgFileName} - block : {BlockName} has no attribute for a cable number. {OffSheets} {@Tags}",
Path.GetFileName(db.Filename),
block.Name,
OffSheets,
attributeRefs.Select(a => a.Tag).ToList());
OffSheetBlocksWithNoCableAttribute.Add(block.Name);
}
}
Notice the
{@Tags} property, it will serialize that list into the log so your receiver(s) can deserialize it and display it in a manner native to the receiver.
TLDR; (
yes, irony) If you want logging, this is the most awesome logging thing I have seen.