logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Elmhorst" <nos...@elmhorst.com>
Subject RE: Reporting events back to Unit-test
Date Wed, 08 Dec 2004 14:58:06 GMT
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




Mime
View raw message