How to force serilog to write log level as int in ElasticSearch

234 Views Asked by At

Currently, I'm using Serilog in my ASP.NET 5 project to log all my logs, and 2 Sinks: SQL Server and ElasticSearch.

Each log has a field "Level" by default, and in SQL Server it is written as integer, but it tries to write it as text to Elasticsearch, and the problem is, that my index is configured to store level property as integer (because another services store it as an integer). I would like to know if there is any way to configure Serilog ElasticSearch to send logs with field "level" as int, not a text?

0

There are 0 best solutions below