You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "William Bosacker (JIRA)" <ji...@apache.org> on 2015/05/18 20:02:00 UTC

[jira] [Commented] (LOG4NET-273) AdoNetAppender does not work if you dont copy System.Data.dll

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

William Bosacker commented on LOG4NET-273:
------------------------------------------

This is definitely an issue, if the System.Data.dll must be in the application folder.  I am not currently certain if this is our issue as well, as our experience is that the logger sometimes works, but for the most part does not.  Any DLL that is in the Global Assembly cache should not be in the application folder under any circumstance.  If log4net is requiring that the DLL be in the application folder, then this is a log4net issue.

> 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: Wish
>    Affects Versions: 1.2.10
>         Environment: Windows 7, .Net 2.0
>            Reporter: Evald
>            Priority: Minor
>             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.3.4#6332)

Re: [jira] [Commented] (LOG4NET-273) AdoNetAppender does not work if you dont copy System.Data.dll

Posted by Dominik Psenner <dp...@gmail.com>.
This is odd, system.data.dll should be part of the .net framework
installation and thus be available via gac.
On 18 May 2015 8:02 pm, "William Bosacker (JIRA)" <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/LOG4NET-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14548415#comment-14548415
> ]
>
> William Bosacker commented on LOG4NET-273:
> ------------------------------------------
>
> This is definitely an issue, if the System.Data.dll must be in the
> application folder.  I am not currently certain if this is our issue as
> well, as our experience is that the logger sometimes works, but for the
> most part does not.  Any DLL that is in the Global Assembly cache should
> not be in the application folder under any circumstance.  If log4net is
> requiring that the DLL be in the application folder, then this is a log4net
> issue.
>
> > 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: Wish
> >    Affects Versions: 1.2.10
> >         Environment: Windows 7, .Net 2.0
> >            Reporter: Evald
> >            Priority: Minor
> >             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.3.4#6332)
>