如何配置NHibernate的探查,所以我可以启用/不改变code禁用它? [英] How do I configure NHibernate Profiler so I can enable/disable it without changing code?

查看:141
本文介绍了如何配置NHibernate的探查,所以我可以启用/不改变code禁用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直努力遵循在NHProf网站的方向,但可以'不像是会使其工作。我缺少什么?

I've been trying to follow the directions on the NHProf site but can't seem to make it work. What am I missing?

我把log4net的配置节在我的web.config:

I put a log4net configuration section in my web.config:

<configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net/>
  ...
</configSections>
...
<log4net>
  <appender name="NHProfAppender" type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender, HibernatingRhinos.Profiler.Appender">
    <sink value="http://localhost:22897"/>
  </appender>
  <logger name="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender.Setup">
    <appender-ref ref="NHProfAppender"/>
  </logger>
<log4net>

而在的Global.asax

protected void Application_Start(...)
{
  ...
  log4net.Config.XmlConfigurator.Configure();
  ...
}

HibernatingRhinos.Profiler.Appender.dll 组件在我的斌\\ 目录,但至今没有骰子。我已经能够验证一个log4net的记录器正在用正确的名称创建的,但我不相信,一个appender与之相关联。任何想法?

The HibernatingRhinos.Profiler.Appender.dll assembly is in my bin\ directory, but so far no dice. I've been able to verify that a log4net logger is being created with the right name, but I don't believe that an appender is associated with it. Any ideas?

推荐答案

我一定是什么地方有一个错字,因为现在一切的工作。所以我想我在做它正确毕竟。

I must have had a typo somewhere, because now everything's working. So I guess I was doing it correctly after all.

这篇关于如何配置NHibernate的探查,所以我可以启用/不改变code禁用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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