-->
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.  [ 3 posts ] 
Author Message
 Post subject: show_sql does not work
PostPosted: Sun Sep 18, 2005 10:22 pm 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
I am trying to make show_sql work in my ASP.NET application. However it is not working. I am using NHibernate 0.9.1. Here are the relevant sections of my Web.Config file:

Code:
  <nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
    <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
    <add key="hibernate.connection.connection_string" value="server=localhost;database=TimeTracker;Integrated Security=SSPI;" />
    <add key="hibernate.use_outer_join" value="true" />
    <add key="hibernate.query.substitutions" value="dbo.File=dbo.[File]" />
    <add key="hibernate.cache.provider_class" value="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache" />
    <add key="hibernate.show_sql" value="true" />
  </nhibernate>
  <log4net>
    <appender name="ServicesLog" type="log4net.Appender.RollingFileAppender">
      <file value="D:/Temp/TimeTrackerLogs/Services.log" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="1MB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" />
      </layout>
    </appender>
    <!-- levels: DEBUG, INFO, WARN, ERROR, FATAL -->
    <root>
      <level value="WARN" />
      <appender-ref ref="ServicesLog" />
    </root>
  </log4net>


Note that log4net debug level is set to WARN. I do not want DEBUG and INFO messages in the log. I only want SQL statements in there. How can I do that?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 3:39 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
SQL is shown using the logger NHibernate.SQL at the DEBUG level. You can enable DEBUG just for this logger by using something like this:
Code:
<logger name="NHibernate.SQL">
    <level value="DEBUG" />
</logger>

in the <log4net> section. See log4net manual on the Internet for more details.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 7:47 am 
Thanks you so much. Somehow I had overlooked the NHibernate.SQL logger. It is all working now.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.