Can't get NHProfAppender to work in MVC application

37 views
Skip to first unread message

Marco

unread,
Feb 23, 2017, 2:09:47 AM2/23/17
to nhprof
NHProf (official licensekey) works when I use HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(); in Global.asax.

But when I try to use the appender through log4net nothing happens. Not using the tcp sink, not using the file option.

I got the NHProfAppender to work in a console application but when I use the same configuration in the mvc application nothing happens. 
Log4net logging is working, I see records being written to the db via another appender in the log4net.config.

Any ideas on how to 'debug' this issue?

Oren Eini (Ayende Rahien)

unread,
Feb 23, 2017, 2:30:26 AM2/23/17
to nhprof
Can you show us your config, or send a small sample project showing the issue?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "nhprof" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+unsubscribe@googlegroups.com.
To post to this group, send email to nhp...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhprof.
For more options, visit https://groups.google.com/d/optout.

Fitzchak Yitzchaki

unread,
Feb 23, 2017, 3:02:56 AM2/23/17
to nhp...@googlegroups.com
Hello,

Which version of log4net are you using?

Try to call NHibernateProfiler.GenerateAssemblyForCustomVersionOfLog4Net and use the generated assembly.

Best Regards,

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Fitzchak Yitzchaki l Senior Software Engineer Mobile:+972-58-345-9538

On Thu, Feb 23, 2017 at 9:08 AM, Marco <marcov...@gmail.com> wrote:

--

Marco

unread,
Feb 23, 2017, 5:02:24 AM2/23/17
to nhprof
Thanks! This remark send me in the right direction to solve the issue.

My web.config  was missing:

 <dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0" />
      </dependentAssembly>

This was present in app.config for the console application.
When I added this lines NHProf started recieving information.


On Thursday, February 23, 2017 at 9:02:56 AM UTC+1, Fitzchak Yitzchaki wrote:
Hello,

Which version of log4net are you using?

Try to call NHibernateProfiler.GenerateAssemblyForCustomVersionOfLog4Net and use the generated assembly.

Best Regards,

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Fitzchak Yitzchaki l Senior Software Engineer Mobile:+972-58-345-9538


On Thu, Feb 23, 2017 at 9:08 AM, Marco <marcov...@gmail.com> wrote:
NHProf (official licensekey) works when I use HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(); in Global.asax.

But when I try to use the appender through log4net nothing happens. Not using the tcp sink, not using the file option.

I got the NHProfAppender to work in a console application but when I use the same configuration in the mvc application nothing happens. 
Log4net logging is working, I see records being written to the db via another appender in the log4net.config.

Any ideas on how to 'debug' this issue?

--
You received this message because you are subscribed to the Google Groups "nhprof" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+un...@googlegroups.com.

Fitzchak Yitzchaki

unread,
Feb 23, 2017, 5:22:48 AM2/23/17
to nhp...@googlegroups.com
OK. Great :-)

Best Regards,

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Fitzchak Yitzchaki l Senior Software Engineer Mobile:+972-58-345-9538


To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages