Akshay Bheda Akshay Bheda -3 years ago 217
reST (reStructuredText) Question

How to configure Serilog in Web Api 2 with OData v4

I am a beginner. I want to know how to Configure Serilog in RestApi to write logs to Seq. What should be the configurations in webapiconfig and Controller. and How to write log event for the same

Answer Source

First you need to install SEQ Server on your machine. The server registers itself as a service in your machine. This service runs on default port no 5341

In the Global.asax file you need to create the instance of the logger.

In the controller you can use variable Log to write the logs of various levels to seq server

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download