These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Logging SQL queries
PostPosted: Tue Jul 11, 2006 11:19 am 
Newbie

Joined: Thu May 04, 2006 2:42 pm
Posts: 10
Location: Columbus, OH
How can I get output of all of the SQL queries that NHibernate is executing, either in the Output window in Visual Studio or in a file?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 11, 2006 12:48 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
Code:
    <add key="hibernate.show_sql" value="true" />


edit: sorry

In your config, if you're using the namevalue handler, then add this to the <nhibernate section:
Code:
    <add key="hibernate.show_sql" value="true" />


if you're using the nhibernate config handler, then add this to the <hibernate-configuration><session-factory> section:

Code:
<property name="hibernate.show_sql">true</property>


Hopefully you have log4net configured, if not then add something like this:

Code:
   <configSections>
      <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
   </configSections>

   <log4net>
      <appender
      name="rollingFile"
      type="log4net.Appender.RollingFileAppender">
         <file value="c:/log/mobyProject.log" />
         <appendToFile value="true" />
         <rollingStyle value="Date" />
         <datePattern value="yyyyMMdd" />
         <layout type="log4net.Layout.PatternLayout">
            <conversionPattern
          value="--%n%date %-5p(%F:%L)%n Class: %c %n %m %n" />
         </layout>
      </appender>
      <root>
         <priority value="ERROR" />
         <appender-ref ref="rollingFile" />
      </root>
   </log4net>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.