logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Avinash (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4NET-384) Log4Net MySql connector
Date Tue, 16 Jul 2013 10:06:49 GMT

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

Avinash commented on LOG4NET-384:
---------------------------------

I have also seen some blogs on this, but non report this issue.
http://blogs.lessthandot.com/index.php/WebDev/ServerProgramming/using-postsharp-and-log4net-to-set-up-co

http://rafayal.blogspot.com/2009/05/using-log4net-with-c-and-mysql.html

                
> Log4Net MySql connector
> -----------------------
>
>                 Key: LOG4NET-384
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-384
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 1.2.11
>         Environment: Windows 7 32bit
>            Reporter: Avinash
>            Priority: Critical
>
> Hi,
> Im having a issue using the mysql connector. Im trying to log to a mysql database with
custom fields. I had a similar confiugration using MS Sql server with no issues, however with
mysql i get the following error:
> log4net:ERROR [AdoNetAppender] ErrorCode: GenericFailure. Exception while writing to
database
> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command
execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Parameter '?ProjectId'
must be defined.
>    at MySql.Data.MySqlClient.Statement.SerializeParameter(MySqlParameterCollection parameters,
MySqlPacket packet, String parmName)
>    at MySql.Data.MySqlClient.Statement.InternalBindParameters(String sql, MySqlParameterCollection
parameters, MySqlPacket packet)
>    at MySql.Data.MySqlClient.Statement.BindParameters()
>    at MySql.Data.MySqlClient.Statement.Execute()
>    at MySql.Data.MySqlClient.PreparableStatement.Execute()
>    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
>    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
>    at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
>    at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
>    at log4net.Appender.AdoNetAppender.SendBuffer(IDbTransaction dbTran, LoggingEvent[]
events)
>    at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events)
> Here is a snippet oog my config:
> <appender name="ADONetAppender" type="log4net.Appender.AdoNetAppender">
>     <bufferSize value="1" />
>     <connectionType value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=6.0.7.0,
Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
>     <connectionString value="Data Source=localhost;database=test; Uid=user;Pwd=password?"
/>
>     <commandText value="INSERT INTO Audit (Date,Logger,ProjectId,Message,Exception)
VALUES (?log_date, ?logger, ?ProjectId, ?message, ?exception)" />
>     <parameter>
>       <parameterName value="log_date" />
>       <dbType value="DateTime" />
>       <layout type="log4net.Layout.RawTimeStampLayout" />
>     </parameter>
>     <parameter>
>       <parameterName value="logger" />
>       <dbType value="String" />
>       <size value="255" />
>       <layout type="log4net.Layout.PatternLayout">
>         <conversionPattern value="%logger" />
>       </layout>
>     </parameter>
>     <parameter>
>       <parameterName value="ProjectId " />
>       <dbType value="String" />
>       <size value="10" />
>       <layout type="log4net.Layout.PatternLayout">
>         <conversionPattern value="%property{ProjectId}" />
>       </layout>
>     </parameter>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message