从IIS 7 WCF应用程序错误日志 [英] Error logs from a WCF application on IIS 7

查看:112
本文介绍了从IIS 7 WCF应用程序错误日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我自己的错,而我只是失去了一些东西明显。我建立一个WCF REST的应用程序,在.NET 4.0中,并将它发展的工作,现在。我推到了我的生产服务器,并登录后,得到一个500错误现在,我敢肯定,这是一个问题,我的应用程序,但这里的难题是 - 我不知道错误是什么 - 我只是得到一个通用的500错误,即使我从lcoalhost做到这一点。于是,我就找了日志,但在日志中没有条目下的Inetpub,只是acouple的一些previous试验400和401错误。我在想什么?在哪里我的WCF应用程序写日志条目?还是我来告诉它来写500错误日志的地方,用手?我将如何做到这一点。

This is my own fault, and I'm just missing something obvious. I am building a WCF REST app, on .Net 4.0, and have it working in development, now. I pushed it up to my production server, and get a 500 error after logging in. Now, I'm sure this is an issue with my application, but here's the rub - I have no idea what the error is - I just get a generic 500 error, even if I do it from the lcoalhost. So, I went looking for a log, but there is no entry in the logs under inetpub, just acouple of 400 and 401 errors from some previous experimenting. What am I missing? Where does my WCF app write log entries to? Or do I have to tell it to write 500 errors to a log somewhere, by hand? How would I do that.

推荐答案

WCF应用程序不写日志,除非你已经添加记录到他们。

WCF apps don't write logs, unless you've adding logging to them.

然而,WCF堆栈可以任选,写入跟踪文件了,你可以,有时,用它来追查内部异常。 MSDN有说明如何启用和查看它们。

However the WCF stack can, optionally, write trace files out which you can, sometimes, use to track down the inner exceptions. MSDN has instructions on how to enable and view them.

不过该页面不显示你如何配置文件记录,而不是之一呢。您将需要添加一个XML跟踪监听器,写入一个文件,

However that page doesn't show you how to configure file logging, instead this one does. You will need to add an XML trace listener which writes to a file,

        <listeners>
           <add name="traceListener" 
               type="System.Diagnostics.XmlWriterTraceListener" 
               initializeData= "c:\log\Traces.svclog" />
        </listeners>

这篇关于从IIS 7 WCF应用程序错误日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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