Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net WebAPI RC ILogger

I just upgraded to the RC of webApi and found that a whole lot of things are no longer as they were.

We were using the ILogger ( http://msdn.microsoft.com/en-us/library/system.web.http.common.ilogger(v=vs.108).aspx) interface to log events/exceptions from inside our API. However after upgrading this no longer seems to exist. Does anyone know where this has gone/what this has turned into?

like image 512
Not loved Avatar asked Apr 13 '26 12:04

Not loved


1 Answers

With new WebAPI the ILogger interface has been removed and now you should be using ITraceWriter instead as described below:

Monitoring and diagnostics: You can enable tracing by providing an ITraceWriter implementation and configuring it as a service using the dependency resolver. The ILogger interface has been removed.

Here is the official documentation and here is an example to start with ITraceWriter

like image 134
AvkashChauhan Avatar answered Apr 16 '26 00:04

AvkashChauhan