You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Simon Evieux (JIRA)" <ji...@apache.org> on 2017/08/31 09:02:00 UTC

[jira] [Comment Edited] (LOG4NET-538) AdoNetAppender to PostgreSQL

    [ https://issues.apache.org/jira/browse/LOG4NET-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16148679#comment-16148679 ] 

Simon Evieux edited comment on LOG4NET-538 at 8/31/17 9:01 AM:
---------------------------------------------------------------

I guess not (I mean it is not coming from postgreSQL interpreting differently the parameters...)... And by the way, I already tried to change from @log_date to :log_date and to no prefix at all without any success

As explained by Cristian and myself.
If I do exactly the same with the version 1.2.10 of log4net, it works well.
It seems it does not work any more since version 1.2.15 of log4net.

The only thing I did this morning is downgrade from log4net 2.0.8 to log4net 1.2.10. I did not change anything in my postgreSQL server, nor to my providers nor to my log4net.config file.


was (Author: s.evieux):
I guess not (I mean it is not coming from postgreSQL interpreting differently the parameters...)...

As explained by Cristian and myself.
If I do exactly the same with the version 1.2.10 of log4net, it works well.
It seems it does not work any more since version 1.2.15 of log4net.

The only thing I did this morning is downgrade from log4net 2.0.8 to log4net 1.2.10. I did not change anything in my postgreSQL server, nor to my providers nor to my log4net.config file.

> AdoNetAppender to PostgreSQL
> ----------------------------
>
>                 Key: LOG4NET-538
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-538
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.15
>         Environment: C#
>            Reporter: Cristian Margescu
>              Labels: patch
>
> I am using the AdoNetAppender to log audits to the database. I was using until some time the 1.2.13 version with a configuration for MSSQL or PostgreSQL which inserted practically data as json strings that will later be interpreted by another tool using the following appender configuration. 
> EX: <appender name="NpgsqlAppender" type="log4net.Appender.AdoNetAppender">
>     <filter type="log4net.Filter.LevelRangeFilter">
>       <levelMin value="AUDIT" />
>       <levelMax value="AUDIT" />
>     </filter>
>     <bufferSize value="1"/>
>     <connectionType
>       value="Npgsql.NpgsqlConnection, Npgsql" />
>     <connectionString
>       value="Server={myServer};Port=5432;Database={database};User Id={myuser};Password={mypassword}" />
>     <commandText value="INSERT INTO audit (message) VALUES (@message);" />
>     <reconnectOnError value="true" />
>     <useTransactions value="false"/>
>     <parameter>
>       <parameterName value="@message" />
>       <dbType value="String" />
>       <layout type="log4net.Layout.PatternLayout" >
>         <conversionPattern value="%message"/>
>       </layout>
>     </parameter>
>   </appender>
> It worked great until I have updated to 1.2.15 and then we have noticed that the PosgreSQL appender did not worked any more. After doing some research and testing I have narrowed it down to the AdoNetAppender
> that probably has a problem with the parameters because it shows a PG error 47203 as column "message" not found.
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)