asp.net mvc日志框架(asp.net mvc logging framework)
我们需要一个允许我们执行以下操作的日志框架
- 记录所有未处理的异常
- 记录用户访问的页面并能够重现其历史记录(因此我们可以针对用户使用模式更好地尝试和优化网站)
- 记录我们可能要在代码中的不同位置输出的任何自定义消息,即。 警告/信息
- 记录asp.net会员成功/失败
- 记录任何其他系统相关事件
我已经看到ELMAH会做#1,asp.net健康监控似乎会处理#4和#5以及可能#2(虽然不是100%肯定),还有像NLog或Log4Net这样的东西将照顾#3。
我确实找到了一个关于实现所有这些的教程 ,但是我想知道是否需要将所有这些库仅用于这种类型的日志记录,看起来有点多,然后你就有了尝试将它们组合成标准类型的开销如果那就是你要如何显示它们。
有比这更简单的方法吗?
We need a logging framework that would allow us to do the following
- Log all unhandled exceptions
- 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)
- Log any custom messages that we might want to output in various places in the code, ie. warning/information
- Log asp.net membership sucess/failure
- 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
最满意答案
您正在使用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 Web Service中使用什么框架?(SOAP)(How to decide on what framework to use in Java Web Service?(SOAP))[2021-10-29]
请注意,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 ... -
java web服务SOAP(java web service SOAP)[2022-05-22]
如果没有首先生成有效的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和/或 ...
-
使用php soap服务器和java客户端的Web服务[关闭](Web service using php soap server and java client [closed])[2022-07-07]
根据定义: 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 ...