-->
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: log4net logging stop working after upgrading to 1.0 RC/1.0
PostPosted: Thu Oct 13, 2005 10:50 pm 
Newbie

Joined: Tue Jun 28, 2005 6:08 pm
Posts: 3
It used to work happily with 0.8.4 and 0.9, and has stopped logging after I upgraded to 1.0RC and 1.0 Release version.

The client application communicates with the app server using remoting, and the app server uses NHibernate to talk to db server.

I follow this link: http://wiki.nhibernate.org/display/NH/Configuring+log4net+Logging

But could not get any one of the example working.

Here's my config file:
Code:
<configuration>
    <!-- Custom Configuration Section -->
   <configSections>
      
      <!--NHiberate and Logging -->
      <section
         name="nhibernate"
         type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
      <section
         name="log4net"
         type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

   </configSections>
   
   <!--NHiberate and Logging -->
   <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=DEVPC20;Database=dbname;Integrated Security=SSPI" />
      <add key="hibernate.show_sql" value="true" />
   </nhibernate>
   <log4net>
      <appender name="NHibernateFileLog" type="log4net.Appender.RollingFileAppender">
         <file value="Logs/nhibernate.txt" />
         <appendToFile value="true" />
         <rollingStyle value="Size" />
         <maxSizeRollBackups value="10" />
         <maximumFileSize value="100KB" />
         <staticLogFileName value="true" />
         <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n"  />
         </layout>
      </appender>

      <appender name="GeneralLog" type="log4net.Appender.RollingFileAppender">
         <file value="Logs/general.txt" />
         <appendToFile value="true" />
         <maximumFileSize value="100KB" />
         <rollingStyle value="Size" />
         <maxSizeRollBackups value="5" />
         <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n"  />
         </layout>
      </appender>
      <appender name="DataLog" type="log4net.Appender.RollingFileAppender">
         <file value="Logs/data.txt" />
         <appendToFile value="true" />
         <maximumFileSize value="100KB" />
         <rollingStyle value="Size" />
         <maxSizeRollBackups value="5" />
         <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="INFO"/>
         <appender-ref ref="GeneralLog" />
      </root>
      
      <logger name="NHibernate" additivity="false">
         <level value="INFO"/>
         <appender-ref ref="NHibernateFileLog"/>
      </logger>
      <logger name="Pushable.Data" additivity="false">
         <level value="INFO"/>
         <appender-ref ref="DataLog"/>
      </logger>
   </log4net>
</configuration>


Any help will be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 4:11 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You need to configure log4net manually starting from 1.0-rc1 (I think). Previous versions of NHibernate called XmlConfigurator.Configure to do this, now you have to call it yourself. And you have some choice about whether to use XmlConfigurator or some other means of configuring 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.