Return-Path: X-Original-To: apmail-logging-log4net-user-archive@www.apache.org Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B3E9E9FEB for ; Sat, 2 Jun 2012 23:10:59 +0000 (UTC) Received: (qmail 98104 invoked by uid 500); 2 Jun 2012 23:10:59 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 97993 invoked by uid 500); 2 Jun 2012 23:10:58 -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" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 97982 invoked by uid 99); 2 Jun 2012 23:10:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2012 23:10:58 +0000 X-ASF-Spam-Status: No, hits=4.7 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.139.91.190] (HELO nm4-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.190) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 02 Jun 2012 23:10:51 +0000 Received: from [98.139.91.65] by nm4.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 23:10:30 -0000 Received: from [98.139.91.46] by tm5.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 23:10:30 -0000 Received: from [127.0.0.1] by omp1046.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 23:10:30 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 524545.20694.bm@omp1046.mail.sp2.yahoo.com Received: (qmail 81703 invoked by uid 60001); 2 Jun 2012 23:10:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1338678629; bh=XqhcXjPKdLANCh1MoQh2LAmdAPvFM5YhB/lB1jFeykU=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=F/ZB5tsJVQ+smv7Uz+OgGoFn7UorYSjUgXrzrsbqrgl2VfNFd+FmyucccZ4htN+PODUk4jO83oXksG0/6dDdZ+kEFY5W6KcKQVDZguIXsO7KOYeTQHt+z60DK6XXvNtobqXGABsRQ4ivntGDh2oOYZKgsiBHpnDR2avXPjR3cz0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=VADC2s+3C2O13DpsFssmXC54HYxL07t2CTZ7GIIfDQPCXnAYyEJWc6qSNmmQF69vJg4KC+qddCJYuLomVtITsmBkcM54tnOa4cZdwKwcBG2pHfgN+f2POYBEy+SYPr7dgiOaoI/IoZSHdizDLoL6v/OgJ9JM01vVrvS/BkaLxqY=; X-YMail-OSG: 97uEoXwVM1mD0fGQdtg86tsjSl9qAI7vsFWaHawDjrOaIbO lDIC.K56VZHMv74NxG0xqWetUAV2sJ.8XcIvGLtj2EJnpPkQ9aquqhvljdYz _R84v8v0o45Y6V2agiK36up00LN.8fbG_yLF3ay9Gtq5TJM9lmgdpCY6ksbQ wZftahkgU6KlXpo0V_X0ht2_9LNjzcAbyhXDNnylQp7kL_5TfRCzjkZBj1CN 9PM4uC7zyMDU7.z3QPn4040yChSMnt9da15FFglcpeEMfnQENniRGDKr1X1x 05GL5AQFzQ8V7zMvyoHllBC8OWiY0UzuSMvUYYZM2CQ7iQpAikuvM4wOZCw5 Fa3d1kOiK.Nwn41eap5IxK71Cd2wlSJasqZyTMYLqBS2yCYEb0jTsqlExuhZ b9ldTBHAzjobKsse43H3biUXemKkez9C.XpnyjY5khCh3_Xqphj.1xc9qN4f AGLCMxjkm7ZRp79XW5IjP6usHPDPLHeDqubEdyolCmEWIJGtp81FatTLgP6M HhVJ6Ut2pFC9qTzzoi2R49eGAXhOARKyQBApNVwNb6Rh8Chnj9ShCH1y.oaO ye7f6wtQxdxhpxKF9qoki2uHnUdsQm.AuKU6KNIzlvREzsHdJPEq0pUDM Received: from [184.57.9.111] by web30503.mail.mud.yahoo.com via HTTP; Sat, 02 Jun 2012 16:10:29 PDT X-Mailer: YahooMailWebService/0.8.118.349524 References: <634DB04A473E874B8E923565BAB8874202F82F46@mail02.networks.local> Message-ID: <1338678629.54313.YahooMailNeo@web30503.mail.mud.yahoo.com> Date: Sat, 2 Jun 2012 16:10:29 -0700 (PDT) From: Ron Grabowski Reply-To: Ron Grabowski Subject: Re: ILog Wrapping To: Log4NET User In-Reply-To: <634DB04A473E874B8E923565BAB8874202F82F46@mail02.networks.local> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1700112988-294661173-1338678629=:54313" X-Virus-Checked: Checked by ClamAV on apache.org ---1700112988-294661173-1338678629=:54313 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The original poster specifically mentioned he did not want to have to walk = to the call stack. Log4net internally walks the call stack so there's no ne= ed to walk it twice.=0A=0AThe Stack Overflow article is correct. Here's ano= ther example:=0A=0Ahttp://svn.apache.org/viewvc/ibatis/cs/ibatisnet-1/trunk= /src/IBatisNet.Common.Logging.Log4Net/=0A=0AThe key concept is needing to p= ass in the Type of your wrapper to the actually log method so log4net knows= to skip over that stack frame when its processing call information.=0A=0A= =0A=0A________________________________=0A From: Martin Milan =0ATo: Log4NET User =0AS= ent: Friday, June 1, 2012 4:13 AM=0ASubject: RE: ILog Wrapping=0A =0A=0ACan= you not walk the call stack until you come across a method that is not fro= m the same namespace as your wrapper?=0A=C2=A0=0AJust an idea=E2=80=A6=0A= =C2=A0=0A=C2=A0=0AFrom:Andreas HOELZLWIMMER [mailto:andreas.hoelzlwimmer@ra= con.at] =0ASent: 01 June 2012 08:36=0ATo: log4net-user@logging.apache.org= =0ASubject: ILog Wrapping=0A=C2=A0=0AHi, =0AI need to switch our logger to = Log4Net in our application. I need to implement our personal logging interf= ace, which means I need to wrap the Logger. The logger requires to display = method name and namespace. With the "usual" way it always shows the method = and namespace of the wrapper, not the method called. The option found on st= ackoverflow (http://stackoverflow.com/questions/157232/how-to-log-methodnam= e-when-wrapping-log4net) does not help and I wanted to know if there is a w= ay to log the correct method/namespace without having to go back in the cal= l stack. Is there a best practise for wrapping ILog? =0Abest regards, =0AAn= dreas =0A=0A=0ADer Austausch von Nachrichten mit o.a. Absender via e-mail d= ient ausschlie=C3=9Flich Informationszwecken. Rechtsgesch=C3=A4ftliche Erkl= =C3=A4rungen d=C3=BCrfen =C3=BCber dieses Medium nicht ausgetauscht werden.= =0A=0ACorrespondence with a.m. sender via e-mail is only for information pu= rposes. This medium is not to be used for the exchange of legally-binding c= ommunications.Enserve Group Legal Disclaimer =0AEnServe Group Limited ("En= Serve"), registered in England and Wales with registration number 3250709.= EnServe's registered office is at Hertsmere House, Shenley Road, Borehamwoo= d, Herts, WD6 1TE, United Kingdom and a list of EnServe's subsidiaries and= their registered particulars is available for inspection at this location.= This email and any attachments to it are confidential and are intended so= lely for the use of the individual to whom it is addressed. Any views or o= pinions expressed are solely those of the author and do not necessarily rep= resent those of EnServe or its subsidiaries. If you are not the intended r= ecipient of this email, you must neither take any action based upon its con= tents, nor copy or show it to anyone. Please contact the sender if you bel= ieve you have received this email in error. =0A=0AThis message has been sca= nned by Symantec Mail Security ---1700112988-294661173-1338678629=:54313 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
The original poster s= pecifically mentioned he did not want to have to walk to the call stack. Lo= g4net internally walks the call stack so there's no need to walk it twice.<= /span>

The Stack Overflow artic= le is correct. Here's another example:

http://svn.apache.org/viewvc/ibatis/cs/ibatisnet-1/trunk/src= /IBatisNet.Common.Logging.Log4Net/

=
The key concept is needing to pass in the Type of your wrapper t= o the actually log method so log4net knows to skip over that stack frame wh= en its processing call information.


= From: Martin Milan <Ma= rtin.Milan@enservegroup.com>
T= o: Log4NET User <log4net-user@logging.apache.org>
= Sent: Friday, June 1, 2012 4:= 13 AM
Subject: RE: ILo= g Wrapping

=0A
Can you = not walk the call stack until you come across a method that is not from the= same namespace as your wrapper?
 
<= span style=3D"font-size:11.0pt;font-family:"sans-serif";color:#1F= 497D;">Just an idea=E2=80=A6
 
 
From: Andreas HOELZLWIMMER [mailto:andr= eas.hoelzlwimmer@racon.at]
Sent: 01 June 2012 08:36
To: log4net-user@logging.apache.org
Subject: ILog Wrapping
 
Hi,
I nee= d to switch our logger to Log4Net in our application. I need to implement o= ur personal logging interface, which means I need to wrap the Logger. The l= ogger requires to display method name and namespace. With the "usual" way i= t always shows the method and namespace of the wrapper, not the method call= ed. The option found on stackoverflow (http://stackoverflow.com/questions/157232/how-to-log-methodn= ame-when-wrapping-log4net) does not help and I wanted to know if there= is a way to log the correct method/namespace without having to go back in = the call stack. Is there a best practise for wrapping ILog?
bes= t regards,
Andreas
<= br>
Der Austausch von Nachrichten mit o.a. Absender via e-mail dien= t ausschlie=C3=9Flich Informationszwecken. Rechtsgesch=C3=A4ftliche Erkl=C3= =A4rungen d=C3=BCrfen =C3=BCber dieses Medium nicht ausgetauscht werden.

Corr= espondence with a.m. sender via e-mail is only for information purposes. Th= is medium is not to be used for the exchange of legally-binding communicati= ons.
=0A=0A Enserve Group Legal Disclaimer </title= >=0A=0A<div>=0A=0A<div><font face=3D"calibri" size=3D"1">EnServe Group Limi= ted ("EnServe"), registered in England and Wales with =0A=0Aregistration nu= mber 3250709.EnServe's registered office is at Hertsmere House, Shenley Roa= d, Borehamwood, Herts, WD6 1TE, United =0A=0AKingdom and a list of EnServe'= s subsidiaries and their registered particulars is available for inspection= at this location. This =0A=0Aemail and any attachments to it are confident= ial and are intended solely for the use of the individual to whom it is add= ressed. =0A=0AAny views or opinions expressed are solely those of the autho= r and do not necessarily represent those of EnServe or its =0A=0Asubsidiari= es. If you are not the intended recipient of this email, you must neither t= ake any action based upon its contents, nor =0A=0Acopy or show it to anyone= . Please contact the sender if you believe you have received this email in = error.=0A<br>=0A</font></div><div align=3D"Center"><font face=3D"calibri" s= ize=3D"1"><font face=3D"Arial" size=3D"2"><b>This message has been scanned = by Symantec Mail Security</b></font></font></div><font face=3D"calibri" siz= e=3D"1">=0A=0A=0A</font></div><font face=3D"calibri" size=3D"1">=0A=0A</fon= t></div></div><meta http-equiv=3D"x-dns-prefetch-control" content=3D"on"><b= r><br> </div> </div> </div></body></html> ---1700112988-294661173-1338678629=:54313--