Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 952011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:49:32+00:00 2026-05-15T23:49:32+00:00

Odd one this. I am using NHibernate with one website. I have configured log4net

  • 0

Odd one this.

I am using NHibernate with one website. I have configured log4net to show me all SQL and and errors in the trace. It all works swimmingly.

I start using NHibernate in the other website – same solution, built on top of same class libraries. I copy the configuration data in web.config from one website to the other:

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<log4net>
    <appender name="AspNetTraceAppender" type="log4net.Appender.AspNetTraceAppender" >
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <logger name="NHibernate.SQL" additivity="false">
      <level value="DEBUG" />
      <appender-ref ref="AspNetTraceAppender" />
    </logger>
    <root>
      <level value="ERROR"/>
      <appender-ref ref="AspNetTraceAppender"/>
    </root>
  </log4net>

Obviously the new website also has a reference to log4net.dll.

But in the new website, I get no NHibernate output in the trace!

To the best of my knowledge, with log4net you just reference the dll, set up the config and off you go.

Can anyone think what I might be missing?

Thanks

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:49:32+00:00Added an answer on May 15, 2026 at 11:49 pm

    Looks like you’re forgetting to initialize it.

    Take a look at the comment section of this post:

    Logging NHibernate SQL with log4net in ASP.NET

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right, this is an odd one. We have a web service that returns data
I guess this is an odd one, and the answer is most likely it
It's one of those things that seems to have an odd curve where the
I have an odd problem...I'm using a documentation generator which generates a lot of
OK this is an odd one. I wanted to install ASP.NET MVC 2 Beta
This is an odd one. Note this is cut down example code, and misses
This may seem like an odd one, but I want to be able to
I've been bashing my head against this one for a while now. I have
This is a bit of an odd one and apologies if I don't explain
An odd issue that I have been trying to address in a project -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.