在ASP.NET Web API中记录http请求的最佳做法是什么? [英] What is the best practice to log http requests in ASP.NET Web API?

查看:177
本文介绍了在ASP.NET Web API中记录http请求的最佳做法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在使用ASP.NET Web API设计RESTful API平台。

因此我们要记录每个http请求的工作流,例如客户端身份,控制器,操作,业务模块,dal模块

现在我考虑使用消息处理程序,web api过滤器和真正的代理,但如果有更好的练习或库我希望知道它。

你能不能帮助我?



谢谢。

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.

推荐答案

也许这个体面的开源工具是最受欢迎的工具: http://logging.apache.org/log4net [ ^ ]。



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

—SA


为什么不让网络服务器进行日志记录?我见过的每个好的网络服务器都支持HTTP请求记录。
Why not let the webserver do the logging? Every good webserver I've ever seen supports HTTP request logging.


这篇关于在ASP.NET Web API中记录http请求的最佳做法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆