Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My team is designing the RESTful API platform with ASP.NET Web API.
So we want to log workflow for each http request for instance client identity, controllers, actions, biz modules, dal modules and so on.
Now I consider using message handler, web api filters and real proxies but if there is any better practice or library I hope to know it.
Could you help me?

Thanks.
Posted

Perhaps this decent open-source tool is the most popular one: http://logging.apache.org/log4net[^].

—SA
 
Share this answer
 
Comments
Gyuwon Yi 12-Feb-14 22:36pm    
I didn't know log4net is also suitable for ASP.NET Web API.
Thanks for your answer.
Sergey Alexandrovich Kryukov 13-Feb-14 1:07am    
Yes, it is. You are welcome. Will you accept the answer formally (green "Accept" button)?
—SA
Gyuwon Yi 13-Feb-14 3:20am    
Oh, why not?
Sergey Alexandrovich Kryukov 13-Feb-14 8:22am    
Good luck, call again.
—SA
Why not let the webserver do the logging? Every good webserver I've ever seen supports HTTP request logging.
 
Share this answer
 
Comments
Gyuwon Yi 12-Feb-14 23:57pm    
Do you have any idea to let IIS trace the internal workflow of ASP.NET Web API pipeline and more?
Dave Kreskowiak 13-Feb-14 8:39am    
You said "log ... HTTP Request". That's exactly what the web server can do. Log the incoming HTTP request string.

What you're referring to now is logging what the code does internally. That takes a logging library of some kind, such as log4net.
Gyuwon Yi 13-Feb-14 23:25pm    
Thanks so much but I thought you mean IIS not ASP.NET, because you said the word 'webserver'. As you know ASP.NET is not a webserver. :-) One of my team member told me log4net can be heavier than we think though I'm not certain yet. So... the way I found is that using ITraceWriter provided by ASP.NET. We realized that it is helpful to trace the ASP.NET Web API pipeline.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900