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:


----- 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
Documents\Visual Studio
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
Data Source Wizard and a regular Windows DataSet.  For some reason I
get the log4net object to recognize the VistaDB provider.

My Config file is as follows:

    <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, 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" />
    <appender name="AdoNetAppender_Access"
      <bufferSize value="1" />
      <connectionString value="Provider=VistaDB.NET20;Data
Source=C:\Documents and Settings\First Name\My Documents\Visual Studio
      <commandText value="INSERT INTO Log
([Date],[Thread],[newLevel],[Logger],[Message]) VALUES (@log_date,
@log_level, @logger, @message)" />
lots of parameter stuff
      <level value="INFO" />
      <appender-ref ref="FileAppender" />
      <appender-ref ref="AdoNetAppender_Access" />
View this message in context:
Sent from the Log4net - Users mailing list archive at Nabble.com.

View raw message