1

I am debugging an asp.net mvc 4 web site wsccc1. To traced any error, I designed my trace file log in web.config. I use Visual Studio 2012, the default hosted server is IIS Express.

<?xml version="1.0"?>
<configuration>
   <system.web>
     <compilation debug="true" targetFramework="4.5"/>
     <httpRuntime targetFramework="4.5"/>
     <customErrors mode="Off"></customErrors>
   </system.web>
   <system.serviceModel>
     <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true">
     <serviceActivations>
     <add factory="System.ServiceModel.Activation.WebServiceHostFactory"
    relativeAddress="wscccService.svc"
    service="service.wservice"/>
  </serviceActivations>
  <baseAddressPrefixFilters>
    <add prefix="http://localhost:8080/" />
  </baseAddressPrefixFilters>
  </serviceHostingEnvironment>
 <behaviors>
  <serviceBehaviors>
      <behavior>
        <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
  </serviceBehaviors>
 </behaviors>
 <diagnostics>
     <messageLogging logEntireMessage="true"
              logMessagesAtServiceLevel="false"
              logMessagesAtTransportLevel="false"
              logMalformedMessages="true"
              maxMessagesToLog="5000"
              maxSizeOfMessageToLog="2000">
 </messageLogging>
</diagnostics>
</system.serviceModel>
 <system.webServer>
    <validation validateIntegratedModeConfiguration="true" />
    <handlers>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
   </system.webServer>
 <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging">
        <listeners>
        <add name="messagelistener"
         type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="C:\myMessages.svclog"></add>
     </listeners>
  </source>
  </sources>
    <trace autoflush="true"></trace>
  </system.diagnostics>

But I couldn't find any .svclog file in C drive. There are log files in the path 'C:\Users\hui\Documents\IISExpress\TraceLogFiles\wsccc1'. All the files begin with 'fr' such as 'fr00400.xml'. It has the exception information.

My question is why it begin with 'fr'? Is it referred to French but I am in USA?

Also why I could not generate 'C:\myMessages.svclog'.

4

1 回答 1

2

中的文件C:\Users\hui\Documents\IISExpress\TraceLogFiles\wsccc1是 IIS 日志文件:HTTP 请求 url + 响应状态 + 时间戳 +.... HttpLoggingModule 是必需的,它与 WCF 甚至 asp.net 无关。

*.svclog是 WCF 跟踪文件:这通常需要编辑配置文件以启用 WCF 跟踪(如您所做的那样)。一个很好的教程在这里

还有为什么我不能生成'C:\myMessages.svclog'。

可能是因为安全。为 C 盘上的每个人添加完全控制权(不推荐)或指定一个公共目录(例如 c:\logs),每个人都可以在其中生成跟踪日志。

编辑 :

为什么 IIS 日志文件以“fr”开头?

即使我是法国人,它也不是为我们制作的。fr 在这里表示Failed Request。这是 IIS 中称为“失败的请求跟踪”的新功能:它旨在缓冲请求的跟踪事件,并且仅在请求“失败”时将它们刷新到磁盘。这里解释。

于 2013-07-16T14:20:44.587 回答