This project has moved. For the latest updates, please go here.

Picking up log4net's RemoteAppender

Aug 13, 2007 at 9:58 PM
Where did you learn how to work with log4net's RemoteAppender? I'm creating a performance monitoring tool at work that will receive input from our application's log file. I've got log4net's samples working but am having a very hard time trying to implement this in my current app. The reason I'm asking is because I've reviewed your code to see how you implement it but you go way beyond what I need and it's a bit too complex for my needs. Is there any decent source out there for learning how to work with this appender?

Thanks,

Brian
Coordinator
Aug 15, 2007 at 12:05 AM
Hi Brian,

You can have a look at the implementation of the RemotingAppender code: http://www.codeplex.com/log2console/SourceControl/FileView.aspx?itemId=7632&changeSetId=1465
The class you want to receive the log events must implement RemotingAppender.IRemoteLoggingSink and MarshalByRefObject (to be .NET Remoting instanciable).
Have a look in the Initialize method, you need to create a .NET Remoting channel (ChannelServices.RegisterChannel) then register you class (RemotingServices.Marshal), using the settings from a config file for example (what I do).
Then you need to override the LogEvents callback to handle the Log Events.
I hope it helps.

Remy