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 CA0A31846E for ; Wed, 6 Jan 2016 15:47:43 +0000 (UTC) Received: (qmail 72811 invoked by uid 500); 6 Jan 2016 15:47:43 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 72770 invoked by uid 500); 6 Jan 2016 15:47:43 -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 72760 invoked by uid 99); 6 Jan 2016 15:47:43 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2016 15:47:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2AA0C18019E for ; Wed, 6 Jan 2016 15:47:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.424 X-Spam-Level: ***** X-Spam-Status: No, score=5.424 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=3, NML_ADSP_CUSTOM_MED=1.2, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 7uSj0AnyJIv7 for ; Wed, 6 Jan 2016 15:47:34 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 03661231B9 for ; Wed, 6 Jan 2016 15:47:34 +0000 (UTC) Received: from mtom.nabble.com (unknown [162.253.133.81]) by mbob.nabble.com (Postfix) with ESMTP id 99E9A1D89C54 for ; Wed, 6 Jan 2016 07:45:27 -0800 (PST) Date: Wed, 6 Jan 2016 07:59:31 -0700 (MST) From: superfreak3 To: log4net-user@logging.apache.org Message-ID: In-Reply-To: <201601061526.u06FQNVA003821@ruth.10tohost.com> References: <1447515951946-59639.post@n7.nabble.com> <1452045688697-60848.post@n7.nabble.com> <201601061526.u06FQNVA003821@ruth.10tohost.com> Subject: Re: Using Log4Net with Selenium MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_41337_165794588.1452092371239" ------=_Part_41337_165794588.1452092371239 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I was just about to replay that it was as easy as throw. Thank you so much for the replies! On Wed, Jan 6, 2016 at 9:40 AM, Jim Scott-8 [via Apache Logging] < ml-node+s6191n60863h37@n7.nabble.com> wrote: > try > { > //test > } > catch(Exception ex) > { > log.Error(ex); // log your exception > throw; // allow exception to continue > } > ------------------------------ > From: [hidden email] > Sent: =E2=80=8E1/=E2=80=8E6/=E2=80=8E2016 6:57 AM > To: [hidden email] > Subject: Re: Using Log4Net with Selenium > > I've found that sending exceptions to the log in the catch block will > cause the test to be seen as successful overall.=C3=82 How can I also se= t the > test result for Selenium in that block. > =C3=82 > pseudo code:=C3=82 Set MyTestResult =3D Failed. ?? > > On Tue, Jan 5, 2016 at 10:00 PM, mawa316 . <[hidden email] > > wrote: > >> Here's the file I spoke of... >> =C3=82 >> =C3=82 >> >> On Tue, Jan 5, 2016 at 9:01 PM, superfreak3 [via Apache Logging] <[hidde= n >> email] > wrot= e: >> >>> I noticed something strange that has happened since adding logging with >>> log4Net.=C3=82 When exceptions occur, they are caught and written as d= esired to >>> the log.=C3=82 However, running via both mstest and Visual Studio 2015= , despite >>> the fact exceptions occur, the tests are still seen as successful. >>> >>> I verified it has something to do with the logging additions as I got >>> the previous version from TFS and I'm able to run the tests in Visual >>> Studio where the problematic tests do indicate failure. >>> >>> I've attached a file that shows the steps I followed to get logging to >>> work.=C3=82 I'm not sure if the addition of an app.config file causes = this to >>> be handled differently within the testing framework or handling in Visu= al >>> Studio. >>> >>> Any help would be greatly appreciated!! >>> >>> Selenium_and_Log4Net_Logging.docx >>> >>> >>> ------------------------------ >>> If you reply to this email, your message will be added to the discussio= n >>> below: >>> >>> http://apache-logging.6191.n7.nabble.com/Using-Log4Net-with-Selenium-tp= 59639p60848.html >>> To unsubscribe from Using Log4Net with Selenium, click here. >>> NAML >>> >>> >> >> > > ------------------------------ > View this message in context: Re: Using Log4Net with Selenium > > Sent from the Log4net - Users mailing list archive > at > Nabble.com. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-logging.6191.n7.nabble.com/Using-Log4Net-with-Selenium-tp59= 639p60863.html > To unsubscribe from Using Log4Net with Selenium, click here > > . > NAML > > -- View this message in context: http://apache-logging.6191.n7.nabble.com/Usin= g-Log4Net-with-Selenium-tp59639p60865.html Sent from the Log4net - Users mailing list archive at Nabble.com. ------=_Part_41337_165794588.1452092371239 Content-Type: text/html; charset=UTF8 Content-Transfer-Encoding: quoted-printable
I was just about to replay that it was as easy as throw.= =C2=A0 Thank you so much for the replies!
<= br>
On Wed, Jan 6, 2016 at 9:40 AM, Jim Scott-8 [= via Apache Logging] <[hidden email]> wrote:
=09
try{
=C2=A0=C2=A0=C2=A0=C2=A0 //test
}
catch(Exception ex)
{
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 log.Error(ex); // log your exception
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 throw; // allow exception to continue
}

From: [hidden email]
Sent: =E2=80=8E1/=E2=80=8E6/=E2=80= =8E2016 6:57 AM
To: [hidden email]
Subject: Re: Using Log4Net with Seleniu= m

I've found that sending exc= eptions to the log in the catch block will cause the test to be seen as suc= cessful overall.=C3=82=C2=A0 How can I also set the test result for Seleniu= m in that block.
=C3=82=C2=A0
pseudo code:=C3=82=C2=A0 = Set MyTestResult =3D Failed. ??

=09 =09 =09

View this message in context: Re: Using Log4Net with Selenium
Sent from the Log4= net - Users mailing list archive at Nabble.com.
=09 =09 =09 =09
=09
=09
=09
=09=09
If you reply to this email, your mess= age will be added to the discussion below:
=09=09
http://apache-logging.6191.n7.nabble.com/Using-Log4Net-with= -Selenium-tp59639p60863.html =09
=09
=09=09 =09=09To unsubscribe from Using Log4Net with Selenium, click here.
=09=09NAML =09

=09 =09 =09

View this message in context: Re: Using Log4Net wi= th Selenium
Sent from the Log4net - Users mailing list archive at Nabble.com. ------=_Part_41337_165794588.1452092371239--