Ok, got it working.

More exactly, it was already working...but it wouldn't show anything in the
database because the bufferSize attribute was the default one...so it would
only log after 512 log entries...
I added <bufferSize value="1" /> to the configuration and it showed
immediately.

I hope this helps someone that is as distracted as me...

On 9/19/07, Nuno Rocha <[EMAIL PROTECTED]> wrote:
>
> Hmm, I'm using Npgsql as provider for data access.
> NpgsqlConnection inherits DbConnection and so forth.
>
> I've tried to put this working with the following configuration:
>
> <appender name="AdoNetAppender_PGSQL" type="
> log4net.Appender.AdoNetAppender">
>       <connectionType value="Npgsql.NpgsqlConnection, Npgsql"/>
>       <connectionString value="Server=localhost;Database=db;User
> id=user;Password=pass;" />
>       <commandText value="INSERT INTO errors
> (date,thread,level,logger,message) VALUES (:log_date, :thread, :log_level,
> :logger, :message)" />
>       <parameter>
>         <parameterName value="log_date" />
>         <dbType value="DateTime" />
>         <layout type="log4net.Layout.PatternLayout">
>           <conversionPattern value="%date{yyyy'/'MM'/'dd
> HH':'mm':'ss'.'fff}" />
>         </layout>
>       </parameter>
>       <parameter>
>         <parameterName value="thread" />
>         <dbType value="String" />
>         <size value="255" />
>         <layout type="log4net.Layout.PatternLayout">
>             <conversionPattern value="%thread" />
>         </layout>
>       </parameter>
>       <parameter>
>         <parameterName value="log_level" />
>         <dbType value="String" />
>         <size value="50" />
>         <layout type="log4net.Layout.PatternLayout ">
>           <conversionPattern value="%level" />
>         </layout>
>       </parameter>
>       <parameter>
>         <parameterName value="logger" />
>         <dbType value="String" />
>         <size value="255" />
>         <layout type="log4net.Layout.PatternLayout">
>           <conversionPattern value="%logger" />
>         </layout>
>       </parameter>
>       <parameter>
>         <parameterName value="message" />
>         <dbType value="String" />
>         <size value="4000" />
>         <layout type="log4net.Layout.PatternLayout">
>           <conversionPattern value="%message" />
>         </layout>
>       </parameter>
> </appender>
>
> There are no errors in the configuration process and no exception is
> thrown when logging, but no data appear in the database....
>
> Any help??
>
>
> On 9/18/07, Ron Grabowski <[EMAIL PROTECTED]> wrote:
> >
> > If there is an ADO.Net driver for PostgrSQL that implement
> > IDbConnection, IDbCommand, etc. then its supported.
> >
> > ----- Original Message ----
> > From: Nuno Rocha < [EMAIL PROTECTED]>
> > To: [email protected]
> > Sent: Tuesday, September 18, 2007 1:03:17 PM
> > Subject: AdoNetAppender and PostgreSQL
> >
> > Hi,
> >
> > I'm trying to use log4net to log events into a database in PostgreSQL.
> > There is no indication in the website if this is supported or example
> > configurations.
> >
> > Is it possible for anyone to tell me if this is possible and, if yes,
> > how?
> >
> > Regards,
> > Nuno
> >
> >
>

Reply via email to