Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 71169 invoked from network); 9 Feb 2005 06:08:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Feb 2005 06:08:17 -0000 Received: (qmail 77400 invoked by uid 500); 9 Feb 2005 06:08:16 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 77383 invoked by uid 500); 9 Feb 2005 06:08:16 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: "Log4NET User" Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 77370 invoked by uid 99); 9 Feb 2005 06:08:16 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mta7.wss.scd.yahoo.com (HELO mta7.wss.scd.yahoo.com) (66.218.85.38) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 08 Feb 2005 22:08:14 -0800 Received: from [202.138.195.142] by mta7.wss.scd.yahoo.com with HTTP; Tue, 8 Feb 2005 22:08:12 -0800 Date: Wed, 9 Feb 2005 17:08:12 +1100 Message-ID: <42006BC900003B6F@mta7.wss.scd.yahoo.com> In-Reply-To: From: "Diego Barros" Subject: RE: ADONETAppender and stored procedures To: "Log4NET User" MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Aaron, I tried your ADONetReturnValueAppender but am getting the error below. No= w, I changed all the private intsnaces in ADONetAppender to protected, as pe= r your comment in the follow-up email. Tracing through the source I think the ambigiouity is due to the differen= t signatured of the AddParameter method in ADONetReturnValueAppender and AD= ONetValueAppender. Well, that's my guess anyway. public virtual void AddParameter(ADONetReturnValueAppenderParameter param= eter); Is there something else you have changed in ADONetAppender.cs which I may= also need to do? Thanks. Cheers, Diego ---------------- log4net: DOMConfigurator: Configuration update mode [Merge]. log4net: DOMConfigurator: Rendering class [Log4NETTest.AuditEventIDRender= er, Log 4NETTest], Rendered class [Log4NETTest.AuditEvent, Log4NETTest]. log4net: DOMConfigurator: Rendering class [Log4NETTest.AuditEventAddition= alDetai lsRenderer, Log4NETTest], Rendered class [Log4NETTest.AuditEvent, Log4NET= Test]. log4net: DOMConfigurator: Logger [root] Level string is [DEBUG]. log4net: DOMConfigurator: Logger [root] level set to [name=3D"DEBUG",valu= e=3D30000]. log4net: DOMConfigurator: Loading Appender [AuditEventAppender] type: [lo= g4net.A ppender.ADONetReturnValueAppender] log4net: DOMConfigurator: Setting Property [BufferSize] to Int32 value [1= ] log4net: DOMConfigurator: Setting Property [ConnectionType] to String val= ue [Sys tem.Data.SqlClient.SqlConnection, System.Data, Version=3D1.0.3300.0, Cult= ure=3Dneutr al, PublicKeyToken=3Db77a5c561934e089] log4net: DOMConfigurator: Setting Property [ConnectionString] to String value [d ata source=3Dlocalhost;initial catalog=3DTestDB;integrated security=3Dfal= se;persist se curity info=3DTrue;User ID=3Dsa;Password=3D] log4net: DOMConfigurator: Setting Property [CommandText] to String value [usp_Lo gAuditEvent] log4net: DOMConfigurator: Setting Property [CommandType] to CommandType value [S toredProcedure] log4net:ERROR DOMConfigurator: Could not create Appender [AuditEventAppen= der] of type [log4net.Appender.ADONetReturnValueAppender]. Reported error follow= s. System.Reflection.AmbiguousMatchException: Ambiguous match found. at System.RuntimeType.GetMethodImplInternal(String name, BindingFlags binding Attr, Binder binder, CallingConventions callConvention, Type[] types, Par= ameterM odifier[] modifiers, Boolean verifyAccess) at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingA= ttr, Bi nder binder, CallingConventions callConvention, Type[] types, ParameterMo= difier[ ] modifiers) at System.Type.GetMethod(String name, BindingFlags bindingAttr) at log4net.Repository.Hierarchy.DOMHierarchyConfigurator.SetParameter(= XmlElem ent element, Object target) in c:\development\log4net-1.2.0-beta8\src\rep= ository \hierarchy\domhierarchyconfigurator.cs:line 508 at log4net.Repository.Hierarchy.DOMHierarchyConfigurator.ParseAppender= (XmlEle ment appenderElement) in c:\development\log4net-1.2.0-beta8\src\repositor= y\hiera rchy\domhierarchyconfigurator.cs:line 286 log4net:ERROR DOMConfigurator: Appender named [AuditEventAppender] not fo= und. log4net: DOMConfigurator: Hierarchy Threshold [] log4net: Logger: No appenders could be found for logger [myLogger] reposi= tory [l og4net-default-domain] log4net: Logger: Please initialize the log4net system properly. log4net: Logger: Current AppDomain context information: log4net: Logger: BaseDirectory : D:\Code\C#\Log4NETTest\Log4NETTe= st\bin\ Debug\ log4net: Logger: FriendlyName : Log4NETTest.exe log4net: Logger: DynamicDirectory: Done. --------------- >-- Original Message -- >Reply-To: "Log4NET User" >Subject: RE: ADONETAppender and stored procedures >Date: Tue, 8 Feb 2005 08:50:16 -0700 >From: "Hart, Aaron" >To: "Log4NET User" > > >I should also note that I had to change the ADONETAppender class to use >protected variables and functions instead of private in order to inherit= >from it. > >Aaron Hart > >-----Original Message----- >From: Hart, Aaron >Sent: Tuesday, February 08, 2005 7:25 AM >To: 'Log4NET User' >Subject: RE: ADONETAppender and stored procedures > >Diego, > I have done this exact thing, although my intentions were different. I >wanted to create a logging table that has an auto-increment field and be= >able to return the value for that field. Since each logging call could >go be written to multiple ADONETAppenders and therefore have several >sets of result data, the return values are put into an array as >suggested by Nicko. I have been waiting to post my new class on this >list because it has only been minimally tested, but if there is already >need for it, here it is. > I hope I can attach files to this email. If they get filtered off this= >message, I can send them directly to you. Just add these files into the >existing project according to their namespaces. Of course, feel free to >change them as needed. > >Aaron Hart > >-----Original Message----- >From: Diego Barros [mailto:diego@heyboyo.com] >Sent: Monday, February 07, 2005 10:32 PM >To: log4net-user@logging.apache.org >Subject: ADONETAppender and stored procedures > >Hi all, > >I was wondering if the ADONETAppender could make use of output stored >procedure >parameters? I wish the logging to call a stored procedure and then have >it return some values (via output parameters), then use the returned >values >elsewhere. For example, I wish to log to the event log the returned >values >from the stored procedure. > >Would I be better off implementing my own appender (by taking the >ADONetAppender) >and making it do what I want, like get the returned values from the >stored >procedure? > >Any help or pointers as to how I can implement this would be greatly >appreciated. > >Cheers, >Diego >