首页 \ 问答 \ asp.net mvc日志框架(asp.net mvc logging framework)

asp.net mvc日志框架(asp.net mvc logging framework)

我们需要一个允许我们执行以下操作的日志框架

  1. 记录所有未处理的异常
  2. 记录用户访问的页面并能够重现其历史记录(因此我们可以针对用户使用模式更好地尝试和优化网站)
  3. 记录我们可能要在代码中的不同位置输出的任何自定义消息,即。 警告/信息
  4. 记录asp.net会员成功/失败
  5. 记录任何其他系统相关事件

我已经看到ELMAH会做#1,asp.net健康监控似乎会处理#4和#5以及可能#2(虽然不是100%肯定),还有像NLog或Log4Net这样的东西将照顾#3。

我确实找到了一个关于实现所有这些的教程 ,但是我想知道是否需要将所有这些库仅用于这种类型的日志记录,看起来有点多,然后你就有了尝试将它们组合成标准类型的开销如果那就是你要如何显示它们。

有比这更简单的方法吗?


We need a logging framework that would allow us to do the following

  1. Log all unhandled exceptions
  2. Log the pages that a user visits and be able to reproduce their history (so we can try and optimise the site better for user usage patterns)
  3. Log any custom messages that we might want to output in various places in the code, ie. warning/information
  4. Log asp.net membership sucess/failure
  5. Log any other system related events

I've seen that ELMAH will do the #1, the asp.net health monitoring seems like it will handle #4 and #5 and possibly #2 (not 100% sure on that one though), and something like either NLog or Log4Net will take care of #3.

I did find a tutorial on implementing all of these but I'm wondering if its neccessary to have all of those libraries just for this type of logging, seems a bit much and then you have the overhead of trying to combine them into a standard type of view if thats how you are going to display them.

Is there a simpler way than this ?


原文:https://stackoverflow.com/questions/10115621
更新时间:2022-03-11 06:03

最满意答案

您正在使用Bottom-up方法,意味着您从Java方法开始,并从中生成WSDL。

如果您正在使用eclipse,生成WSDL,其简单,New - > Webservice - > Bottom up方法 - >选择您的计算器类(webservice) - > Next - >选择方法并完成。

部署完成后,您可以创建一个新的 - > webservice客户端 - >选择wsdl并生成它。

或者您可以使用wsimport命令:

wsimport -keep -verbose http:// localhost:8888 / ws / server?wsdl


You are using Bottom-up approach, means you start with a Java method, and generate the WSDL from it.

if you are using eclipse, to generate WSDL, its simple, New -> Webservice -> Bottom up approach -> select your calculator class (webservice) -> Next - > select methods and finish.

Once its deployed, you can create a new -> webservice client -> select the wsdl and generate it.

or you can use wsimport command :

wsimport -keep -verbose http://localhost:8888/ws/server?wsdl

相关问答

更多
  • SOAP基本上是使用POST方法将XML提交到Web服务器。 虽然XML可能会变得冗长,但您应该能够使用StringBuilder构造XML,然后使用简单的HTTP客户端(如Apache HttpClient)使用XML字符串作为正文来构造对URL的POST请求。 这就像他们来的一样简单。 SOAP is basically the submission of XML to a web server using the POST method. While the XML can get verbose, ...
  • 不应该有任何特定于Firefox OS的问题 - 如果/当你可以在浏览器中使用它(最好是Firefox浏览器),那么它在Firefox OS中也可以正常工作。 虽然可能会出现一个问题,但如果SOAP服务不提供CORS allow-origin标头 ,那么您的XMLHttpRequest将失败,因为操作系统不允许跨源XHR-s。 您可以通过创建一个Privileged应用程序来解决这个问题,该应用程序在webapp清单中请求SystemXHR权限 ,在这种情况下,您可以向远程服务发出跨源请求 ,而不管CORS ...
  • 请注意,Java具有JAX-WS API,它是用于构建使用XML进行通信的Web服务和客户端的技术。 在JAX-WS中,Web服务操作调用由基于XML的协议(如SOAP)表示。 从您提到的框架中,Spring带来了SpringWS,您可以使用它来构建SOAP Web服务 。 但是我不知道提供任何SOAP功能的Struts 2核心API。 但可以使用其他处理SOAP的插件进行扩展。 Axis(使用最新的Axis 2)是SOAP的不错选择。 它是一个Web服务/ SOAP / WSDL引擎。 它也支持Sprin ...
  • 如果没有首先生成有效的WSDL,则无法调用您的服务。 根据您的错误,Eclipse认为您错过了一个Operation(方法)。 发生这种情况是因为您的Person类没有任何方法。 因此,没有操作。 幸运的是,对于你设置它的方式,你不需要经历并生成基于Person的WSDL。 但是,您的Search类使用Person,WSDL应该生成没有问题。 这是您需要的唯一WSDL。 现在为您的searchBySurname方法,根据您拥有的内容,这似乎不正常。 我的想法(我从这里调试):( a)你的搜索源看起来很好,所 ...
  • 在Drupal模块中使用“SoapClient”解决了这个问题。 以下是我遵循的步骤: 1.下载WSDL文件并将其保存在模块文件夹中。 2.使用任何WSDL到PHP转换器,为下载的WSDL文件创建PHP文件 3.在Drupal模块中复制生成的PHP文件 4.使用以下代码在您的函数中(在Drupal模块内)包含生成的PHP文件: $WSDLPHPPath = drupal_get_path('module', ) .'/< generated PHP file>.php'; requ ...
  • 六个月前,我成功地使用Savon与Bullhorn Staffing SOAP服务进行交互。 我对Savon Gem没有任何问题,所有的麻烦来自与服务的不一致。 我与他们的服务的互动仅限于获取数据(简单)和推送数据,其中可能包括简历文件(更复杂)。 我没有必要比Savon doc更进一步了解所有内容,我认为这很容易理解并且易于应用于我的特定问题。 TLDR; 尽管你可能已经听过,但对萨翁投1票。 I used Savon successfully to interact with the Bullhorn ...
  • 您正在使用Bottom-up方法,意味着您从Java方法开始,并从中生成WSDL。 如果您正在使用eclipse,生成WSDL,其简单,New - > Webservice - > Bottom up方法 - >选择您的计算器类(webservice) - > Next - >选择方法并完成。 部署完成后,您可以创建一个新的 - > webservice客户端 - >选择wsdl并生成它。 或者您可以使用wsimport命令: wsimport -keep -verbose http:// localhos ...
  • 尝试使用CXF代理(服务和客户端)。 在这种情况下,您将获得原始XML到流程中。 当然,如果需要,可以将其反序列化为java,例如通过XML-To-Object转换器(XStream)。 http://www.mulesoft.org/documentation/display/MULE3USER/Proxying+Web+Services+with+CXF 从那里,有几种方法可以在中间转换有效载荷。 要么通过java(如上所述)并转换java层对象,要么编写一个执行转换的XSLT表。或者使用Java和/或 ...
  • 根据定义: Web服务旨在支持网络上可互操作的机器到机器交互。 因此,使用Web服务独立于Web服务的实现技术,现在您可以在SO上搜索“实现基于Java的SOAP客户端”。 加上下面的URL: Java客户端 - PHP Soapserver 这本免费的书由Nan-Chao Huang撰写。 By definition: Web Services have been designed to support interoperable Machine to Machine interaction over a ...
  • 什么是JAXB? 根据我的理解,JAXB用于编组和解组对象? 是的,JAXB是一个框架,可用于将Java对象转换为XML文件(流),反之亦然。 Java对象到XML文件的转换称为编组,反之则编组。 当两个应用程序使用XML交换业务数据时,此技术将非常有用。 2.在同一个春季mvc应用程序中,我可以同时使用宁静的Web服务和SOAP Web服务吗? 是的,您可以根据您的业务需求在同一个项目中同时使用这两个项目。 例如,假设您的应用程序(项目)可能需要来自两个外部来源的数据,即外部系统1(假设它公开了它在SOA ...

相关文章

更多

最新问答

更多
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的
  • SimplePie问题(SimplePie Problem)
  • 在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
  • HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
  • 为什么我会收到链接错误?(Why do I get a linker error?)
  • 如何正确定义析构函数(How to properly define destructor)
  • 垂直切换菜单打开第3级父级。(Vertical toggle menu 3rd level parent stay opened. jQuery)
  • 类型不匹配 - JavaScript(Type mismatch - JavaScript)
  • 为什么当我将模型传递给我的.Net MVC 4控制器操作时,它坚持在部分更新中使用它?(Why is it that when I pass a Model to my .Net MVC 4 Controller Action it insists on using it in the Partial Update?)
  • 在使用熊猫和statsmodels时拉取变量名称(Pulling variable names when using pandas and statsmodels)
  • 如何开启mysql计划事件
  • 检查数组的总和是否大于最大数,反之亦然javascript(checking if sum of array is greater than max number and vice versa javascript)
  • 使用OpenGL ES绘制轮廓(Drawing Outline with OpenGL ES)
  • java日历格式(java Calendar format)
  • Python PANDAS:将pandas / numpy转换为dask数据框/数组(Python PANDAS: Converting from pandas/numpy to dask dataframe/array)
  • 如何搜索附加在elasticsearch索引中的文档的内容(How to search a content of a document attached in elasticsearch index)
  • LinQ to Entities:做相反的查询(LinQ to Entities: Doing the opposite query)
  • 从ExtJs 4.1商店中删除记录时会触发哪些事件(Which events get fired when a record is removed from ExtJs 4.1 store)
  • 运行javascript后如何截取网页截图[关闭](How to take screenshot of a webpage after running javascript [closed])
  • 如何使用GlassFish打印完整的堆栈跟踪?(How can I print the full stack trace with GlassFish?)
  • 如何获取某个exe应用程序的出站HTTP请求?(how to get the outbound HTTP request of a certain exe application?)
  • 嗨,Android重叠背景片段和膨胀异常(Hi, Android overlapping background fragment and inflate exception)
  • Assimp详细说明typedef(Assimp elaborated type refers to typedef)
  • 初始化继承类中不同对象的列表(initialize list of different objects in inherited class)
  • 使用jquery ajax在gridview行中保存星级评分(Save star rating in a gridview row using jquery ajax)
  • Geoxml3 groundOverlay zIndex(Geoxml3 groundOverlay zIndex)