You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Szymon Modelewski (JIRA)" <ji...@apache.org> on 2018/03/15 11:03:00 UTC

[jira] [Commented] (LOG4NET-538) AdoNetAppender to PostgreSQL

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

Szymon Modelewski commented on LOG4NET-538:
-------------------------------------------

Hello,

I face the same issue with log4net 2.0.8 after upgrade from Npgsql 3.2.5 to 3.2.7. Before update logging to Postgresql worked without any problems.

Error from internal logging:

Npgsql.PostgresException (0x80004005): 42703: column "message" does not exist
 w Npgsql.NpgsqlConnector.<DoReadMessage>d__157.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
 w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 w System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
 w Npgsql.NpgsqlConnector.<ReadMessage>d__156.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
 w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 w Npgsql.NpgsqlConnector.<ReadMessage>d__156.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
 w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 w System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
 w Npgsql.NpgsqlConnector.<ReadExpecting>d__163`1.MoveNext()
--- Koniec śladu stosu z poprzedniej lokalizacji, w której wystąpił wyjątek ---
 w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 w Npgsql.NpgsqlCommand.Prepare()
 w log4net.Appender.AdoNetAppender.SendBuffer(IDbTransaction dbTran, LoggingEvent[] events)
 w log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events)

 

Could you give me any feedback when possibly this would be fixed?

> 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
>            Assignee: Dominik Psenner
>            Priority: Major
>              Labels: patch
>             Fix For: 2.0.9
>
>
> 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
(v7.6.3#76005)