You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Olav Benum <ol...@hotmail.com> on 2004/12/08 15:13:05 UTC
Reporting events back to Unit-test
Hi
I am using NUnit and log4net, and I would like to use log4net to report
certain events back to the unit test.
What would be the best way to do this?
It seems I cant generate events and attach to them?
It should be possible to inspect to obtain the relevant logger, and inspect
it at regular intervals.
Also I need to make sure (from unit test at run-time) that what I look for
is really logged.
One situation where I need this is when I want to test an unavailable
connection. This is logged anyway, and as the unit-test dont know the
assembly directly, it would be easiest to communicate through the
logging-framework.
Thanks
Olav
_________________________________________________________________
Free mail? MSN Hotmail ! http://www.msn.be/hotmail
Re: Reporting events back to Unit-test
Posted by DW...@strohlsystems.com.
I would create a special appender for the unit test runs. I would use a
remoting appender that the unit test could attach to and read. As a
separate appender does not stop the original appender(s) from also
executing, so long as the thresholds are the same, you know that the same
information is available in both.
David
"Olav Benum" <ol...@hotmail.com>
12/08/2004 09:13 AM
Please respond to
"Log4NET User" <lo...@logging.apache.org>
To
log4net-user@logging.apache.org
cc
Subject
Reporting events back to Unit-test
Hi
I am using NUnit and log4net, and I would like to use log4net to report
certain events back to the unit test.
What would be the best way to do this?
It seems I can’t generate events and attach to them?
It should be possible to inspect to obtain the relevant logger, and
inspect
it at regular intervals.
Also I need to make sure (from unit test at run-time) that what I look for
is really logged.
One situation where I need this is when I want to test an unavailable
connection. This is logged anyway, and as the unit-test don’t know the
assembly directly, it would be easiest to communicate through the
logging-framework.
Thanks
Olav
_________________________________________________________________
Free mail? MSN Hotmail ! http://www.msn.be/hotmail
IMPORTANT: E-mails from this company normally contain confidential material for the sole use of the intended recipient. The use, distribution, transmittal or re-transmittal by an unintended recipient of any communication is prohibited without our express approval in writing or by e-mail. If you are not the intended recipient please contact the sender and delete all copies. All e-mails sent to or from Strohl Systems are to be used for our business purposes only. E-mails sent from or to the company are subject to review by the company.
RE: Reporting events back to Unit-test
Posted by Andrew Elmhorst <no...@elmhorst.com>.
Log4net comes with MemoryAppender that stores all logged event in memory.
This would be useful for a Unit Test, as it can check the Events property
and get back an array of all the LoggingEvents that have been logged.
Regards,
Andrew Elmhorst
-----Original Message-----
From: Olav Benum [mailto:olavagfa@hotmail.com]
Sent: Wednesday, December 08, 2004 8:13 AM
To: log4net-user@logging.apache.org
Subject: Reporting events back to Unit-test
Hi
I am using NUnit and log4net, and I would like to use log4net to report
certain events back to the unit test.
What would be the best way to do this?
It seems I can't generate events and attach to them?
It should be possible to inspect to obtain the relevant logger, and inspect
it at regular intervals.
Also I need to make sure (from unit test at run-time) that what I look for
is really logged.
One situation where I need this is when I want to test an unavailable
connection. This is logged anyway, and as the unit-test don't know the
assembly directly, it would be easiest to communicate through the
logging-framework.
Thanks
Olav
_________________________________________________________________
Free mail? MSN Hotmail ! http://www.msn.be/hotmail