logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Using log4net with VistaDB
Date Fri, 12 Oct 2007 22:35:12 GMT
You're missing a connectionType node for telling log4net that it should use VistaDBConnection:

 http://logging.apache.org/log4net/release/config-examples.html

----- Original Message ----
From: ckantzer <chris.kantzer@amentra.com>
To: log4net-user@logging.apache.org
Sent: Friday, October 12, 2007 1:30:27 PM
Subject: Using log4net with VistaDB



I am trying use log4net to write to a database.  The database we are
 using is
VistaDB.  I am able to write to a file correctly but I'm getting the
following error when i try to write to the VistaDB file:

log4net:ERROR [AdoNetAppender] Could not open database connection
[Provider=VistaDB.NET20;Data Source=C:\Documents and Settings\First
 Name\My
Documents\Visual Studio
2005\Projects\TestApp\TestDB.vdb3;OpenMode=NonexclusiveReadWrite]
System.InvalidOperationException: The 'VistaDB.NET20' provider is not
registered on the local machine.

I am using .Net 3.0.  The VistaDB product came with a .Net Provider
(VistaDB.NET20) and I can write records just fine in a test app using
 the
Data Source Wizard and a regular Windows DataSet.  For some reason I
 can't
get the log4net object to recognize the VistaDB provider.

My Config file is as follows:

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

  </configSections>

 <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
      <file value="log-file.txt" />
      <appendToFile value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <appender name="AdoNetAppender_Access"
type="log4net.Appender.AdoNetAppender">
      <bufferSize value="1" />
      <connectionString value="Provider=VistaDB.NET20;Data
Source=C:\Documents and Settings\First Name\My Documents\Visual Studio
2005\Projects\TestApp\TestDB.vdb3;OpenMode=NonexclusiveReadWrite""/>
      <commandText value="INSERT INTO Log
([Date],[Thread],[newLevel],[Logger],[Message]) VALUES (@log_date,
 @thread,
@log_level, @logger, @message)" />
      <parameter>
lots of parameter stuff
      </parameter>
    </appender>
    <root>
      <level value="INFO" />
      <appender-ref ref="FileAppender" />
      <appender-ref ref="AdoNetAppender_Access" />
    </root>
  </log4net>
-- 
View this message in context:
 http://www.nabble.com/Using-log4net-with-VistaDB-tf4614199.html#a13177061
Sent from the Log4net - Users mailing list archive at Nabble.com.





Mime
View raw message