为什么不在主机环境中记录ASP.NET日志。(IIS)

时间:2015-03-26 05:50:56

标签: c# asp.net iis log4net

我在IIS6中托管了我的asp.net网站,但它不是记录日志数据。我的本地机器没有问题,并记录所有日志数据(Visual Studio 2010)。我用过Log4Net dll。请帮我。这是我的网络配置文件数据。

 <log4net>
  <root>
  <level value="INFO" />
  <appender-ref ref="InfoLogAppender" />
  <appender-ref ref="ConsoleAppender" />
  <appender-ref ref="TraceLogAppender" />
</root>

<logger name="InfoLogger" additivity="false">
  <level value="INFO" />
  <appender-ref ref="InfoLogAppender" />
</logger>

<logger name="ErrorLogger" additivity="false">
  <level value="ERROR" />
  <appender-ref ref="ErrorLogAppender" />
</logger>

 <logger name="TraceLogger" additivity="false">
  <level value="INFO"/>
  <appender-ref ref="TraceLogAppender"/>
</logger>
<appender name="TraceLogAppender" type="log4net.Appender.RollingFileAppender">
  <param name="File" value="Logs\\TraceLog.txt" />
  <param name="AppendToFile" value="true" />
  <param name="maximumFileSize" value="1024KB" />
  <param name="maxSizeRollBackups" value="20" />
  <layout type="log4net.Layout.PatternLayout">
    <param name="Header" value="[START]\r\n" />
    <param name="Footer" value="[END]\r\n" />
    <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
  </layout>
</appender>
<appender name="InfoLogAppender" type="log4net.Appender.RollingFileAppender">
  <param name="File" value="Logs\\InfoLog.txt" />
  <param name="AppendToFile" value="true" />
  <param name="maximumFileSize" value="1024KB" />
  <param name="maxSizeRollBackups" value="20" />
  <layout type="log4net.Layout.PatternLayout">
    <param name="Header" value="[START]\r\n" />
    <param name="Footer" value="[END]\r\n" />
    <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
  </layout>
</appender>
<appender name="ErrorLogAppender" type="log4net.Appender.RollingFileAppender">
  <param name="File" value="Logs\\ErrorLog.txt" />
  <param name="AppendToFile" value="true" />
  <param name="maximumFileSize" value="1024KB" />
  <param name="maxSizeRollBackups" value="20" />
  <layout type="log4net.Layout.PatternLayout">
    <param name="Header" value="[START]\r\n" />
    <param name="Footer" value="[END]\r\n" />
    <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
  </layout>
</appender>

</log4net>

0 个答案:

没有答案