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 Ron Grabowski <ro...@yahoo.com> on 2005/06/07 20:25:11 UTC

Logger/Appender that listens for events, then logs messages

Suppose I have an object that when processes things internally raises
events to give status updates. 

Is it possible to configure log4net in such a way that it registers for
these events then logs the message through the log4net framework?

I'd like to do this via the xml config file.



Re: Logger/Appender that listens for events, then logs messages

Posted by Ron Grabowski <ro...@yahoo.com>.
Could I extend PluginSkeleton and include code to register for the
event(s) I want to capture? When the event is fired my plugin would
handle recording an appropriate log message ??? 

--- Niall Daley <ni...@apache.org> wrote:

> Ron,
> 	Log4Net doesn't support registering for events, it just logs when
> you tell it to. I think the most straigh forward way to implement
> this
> would be to make a simple event sink that logs via log4net and
> register
> that on the events you are interested in.
> 
> On Tue, 7 Jun 2005, Ron Grabowski wrote:
> 
> > Suppose I have an object that when processes things internally
> raises
> > events to give status updates.
> >
> > Is it possible to configure log4net in such a way that it registers
> for
> > these events then logs the message through the log4net framework?
> >
> > I'd like to do this via the xml config file.
> >
> >
> >
> 
> -- 
> Niall Daley
> Log4net Dev
> 


Re: Logger/Appender that listens for events, then logs messages

Posted by Niall Daley <ni...@apache.org>.
Ron,
	Log4Net doesn't support registering for events, it just logs when
you tell it to. I think the most straigh forward way to implement this
would be to make a simple event sink that logs via log4net and register
that on the events you are interested in.

On Tue, 7 Jun 2005, Ron Grabowski wrote:

> Suppose I have an object that when processes things internally raises
> events to give status updates.
>
> Is it possible to configure log4net in such a way that it registers for
> these events then logs the message through the log4net framework?
>
> I'd like to do this via the xml config file.
>
>
>

-- 
Niall Daley
Log4net Dev