logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Richardson <RDRichard...@rad-con.com>
Subject AdoNetAppender not working PostgreSQL database using Npgsql
Date Fri, 30 May 2014 18:47:16 GMT

I am trying to get an AdoNetAppender to work, and I'm not succeeding.  For now, all I'm trying
to do is to write a constant message to a database table.  Along with the AdoNetAppender,
I have a RollingFileAppender that is working well.  I should get one record in my log table
for every line in the log file.  I'm not getting anything.

This project is built in Microsoft Visual Studio 2008, and is running under Windows 7.  I
am using the ConfigureAndWatch() method to set up my application's logger.

Here is the configuration file I'm using:

<?xml version="1.0" encoding="utf-8"?>
  <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
    <file value="CraneSimulator2.log" />
    <appendToFile value="true" />
    <maxSizeRollBackups value="90" />
    <rollingStyle value="Size" />

    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date - %message%newline" />
<appender name="NpgsqlAppender" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="5" />
    <connectionType value="Npgsql.NpgsqlConnection, Npgsql, Version=, Culture=neutral,
PublicKeyToken=5d8b90d52f46fda7" />
    <connectionString value="Server=;Port=5434;Database=CraneSimulatorLog;User
Id=xxxx;Password=yyyyyyyy;" />
    <commandText value="INSERT INTO Log (message) VALUES ('This is a log message')" />
     <level value="DEBUG" />
     <appender-ref ref="RollingFile" />
     <appender-ref ref="NpgsqlAppender" />


Before this, I tried using ODBC, and that didn't work either.

Can anyone tell me what's wrong, or suggest a way in which I can see what error is happening?
 There are no error messages in the PostgreSQL log files.

Thanks very much!


View raw message