log4net的工程开发机器上,在部署到共享主机发生故障时(使用相同的DB / CONNSTRING) [英] Log4Net works on Dev machine, fails when deployed to shared host (using same db/connstring)

查看:185
本文介绍了log4net的工程开发机器上,在部署到共享主机发生故障时(使用相同的DB / CONNSTRING)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我log4net的配置和我的本地机器工作正常,但是当我部署到我的主机(GoDaddy的),它静静地失败。我用我的dev的机器上相同的数据库/ config文件,并在主机上。我的log4net的参考值设置为复制的地方,并在主机上的槽的log4net.dll,.PDB,和.xml存在。这是一个asp.net MVC应用程序。

I have log4net configured and working fine on my local machine, however when I deploy to my host (godaddy) it fails silently. I am using the same database/config file on my dev machine, and on the host. My log4net reference is set to copy local, and the log4net.dll, .pdb, and .xml exist in the bin on the host. This is an asp.net mvc app.

编辑:没有引发异常,并且应用程序运行正常(减去记录)

这是SQL Server 2005上运行
该虚拟主机提供商是IIS 7

This is running on SQL Server 2005 The webhost is IIS 7

我的配置中突出的细节是:

salient details of my config are:

<root>
  <level value="DEBUG" />
  <appender-ref ref="AdoNetAppender" />
</root>

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
  <bufferSize value="1" />

  <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

任何人有任何的事情的想法来检查?

Anybody have any ideas on things to check?

推荐答案

在我的经验,通常log4net的燕子任何内部错误,只是造成不产生任何结果的日志报表。

In my experience, log4net usually swallows any internal errors, simply resulting in log statements that do not produce any results.

你可能想尝试是让log4net的内部记录。您可以通过添加以下到你的的appSettings 部分做到这一点:

What you may want to try is enable log4net's internal logging. You can do this by adding the following to your appSettings section:

<add key="log4net.Internal.Debug" value="true" />

此设置属性<一个href=\"http://logging.apache.org/log4net/release/sdk/log4net.Util.LogLog.InternalDebugging.html\"><$c$c>LogLog.InternalDebugging真正。现在log4net的将记录到标准输出和错误流和配置的跟踪侦听器。

This sets the property LogLog.InternalDebugging to true. log4net will now log to the standard output and error streams and to configured trace listeners.

您可以使用following配置捕捉到任何信息记录到追踪:

You can use the following configuration to capture any messages logged to tracing:

<system.diagnostics>
  <trace autoflush="false" indentsize="4">
    <listeners>
      <add name="myListener"
        type="System.Diagnostics.TextWriterTraceListener"
        initializeData="c:\TextWriterOutput.log" />
      <remove name="Default" />
    </listeners>
  </trace>
</system.diagnostics>

通过log4net的记录的所有消息在内部将出现在 TextWriterOutput.log 。如果你收到了 SecurityException异常当您添加跟踪监听器的配置,那么很可能是程序池标识不具有足够的权限来创建在指定位置的文件(在例如: C:\\ )。请尝试其他位置或给予程序池的身份足够的权限。

All messages logged by log4net internally will appear in TextWriterOutput.log. If you get a SecurityException when you add the trace listener to your configuration, then very probably the apppool identity does not have sufficient rights to create a file at the specified location (in the example: c:\). Try another location or give the apppool identity sufficient rights.

这篇关于log4net的工程开发机器上,在部署到共享主机发生故障时(使用相同的DB / CONNSTRING)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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