logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4NET-273) AdoNetAppender does not work if you dont copy System.Data.dll
Date Fri, 04 Oct 2013 23:44:41 GMT

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

Dominik Psenner commented on LOG4NET-273:
-----------------------------------------

You are probably right. But Evald might wanted an alternative implementation that does not
depend on System.Data.

> AdoNetAppender does not work if you dont copy System.Data.dll
> -------------------------------------------------------------
>
>                 Key: LOG4NET-273
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-273
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 1.2.10
>         Environment: Windows 7, .Net 2.0
>            Reporter: Evald
>             Fix For: 1.2 Maintenance Release
>
>
> AdoNetAppender does not work if you dont copy System.Data.dll
> log4net writes at output this line: log4net:ERROR [AdoNetAppender] Failed to load connection
type [System.Data.SqlClient.SqlConnection, System.Data]
> if you copy the dll than it begin working.
> here it is my config:
>  <appender name="SQLAppender" type="log4net.Appender.AdoNetAppender">
>       <bufferSize value="1" />    
>       <connectionType value="System.Data.SqlClient.SqlConnection, System.Data" />
>       <connectionString value="Data Source=localhost;initial catalog=testlog4net;integrated
security=false;User ID=sa;Password=mypassword" />
>       <commandText value="INSERT INTO testlog4net.dbo.Log ([Date],[Thread],[LevelName],[Logger],[Message])
VALUES (@log_date, @thread, @log_level, @logger, @message)" />
>       <parameter>
>         <parameterName value="@log_date" />
>         <dbType value="Datetime" />
>         <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}"
/>
>       </parameter>
>       <parameter>
>         <parameterName value="@thread" />
>         <dbType value="String" />
>         <size value="255" />
>         <layout type="log4net.Layout.PatternLayout" value="%thread" />
>       </parameter>
>       <parameter>
>         <parameterName value="@log_level" />
>         <dbType value="String" />
>         <size value="50" />
>         <layout type="log4net.Layout.PatternLayout" value="%level" />
>       </parameter>
>       <parameter>
>         <parameterName value="@logger" />
>         <dbType value="String" />
>         <size value="255" />
>         <layout type="log4net.Layout.PatternLayout" value="%logger" />
>       </parameter>
>       <parameter>
>         <parameterName value="@message" />
>         <dbType value="String" />
>         <size value="4000" />
>         <layout type="log4net.Layout.PatternLayout" value="%message" />
>       </parameter>
>         
>     </appender>
> Thank you
> Regards



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message