How to view serilog records from SQL Server with Seq

2.8k Views Asked by At

I use ASP.NET MVC and serilog, I want to read and view and analyze recorded logs with Serilog in sql server, I find seq that let to add logs to seq like:

Log.Logger = new LoggerConfiguration()
            .WriteTo.Seq("http://localhost:5341")

That is perfect I could add the logs to seq and check them. But I want to view and read logs that already stored in Sql server:

var log = new LoggerConfiguration()
    .WriteTo.MSSqlServer(connectionString, tableName, columnOptions: columnOptions)
    .CreateLogger();

So I already have records in DB, is there any way to read the records in Sql server with seq? or does any one have any idea with another free tool to read the serilog records from sql server?

1

There are 1 best solutions below

1
On

Seq uses its own data store and not a database like SQL. It is file based data store. LinqPad or SQL Server Management Studio (SSMS) is how I currently query our Serilog database log.

Links to Seq's documentation:

One can also write a conversion program to push the data from SQL to Seq. You can use either of the following methods to get the data into Seq. Once it is in then use the Seq interface for querying.