Groups | Blog | Home
all groups > c# > august 2003 >

c# : how to wire up 2 trace listeners to the same windows app?



pokémon
8/20/2003 10:05:05 PM
Ok, I am baffled by this one:

I have 2 custom trace listeners (classes that inherit from
System.Diagnostics.TraceListener).

I want them both to listen to the same Windows application. How should I go
about doing this? Do they need to be in the same AppDomain? Do I need to
create an AppDomain?

I put the both in the <listeners> App.Config section for the app I want them
both to listen to, but, it seems only one of them is listening. Anyone out
there try this yet?

mia lanui
8/21/2003 1:23:02 AM
OK, I figured the first part of my problem: I didn't realize that each app
was loading it's own instance of the listener dll, even though they are in
the same directory.

What I really need to do is have the listener (whose instance is loaded by
the main app) publish an event through a remoted server object. Then the 2nd
app (the monitor) can subscribe to this event. I will try it tomorrow.

(ML, a.k.a. pokémon)

[quoted text, click to view]

AddThis Social Bookmark Button