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

  • Thread starter Thread starter pokémon
  • Start date Start date
P

pokémon

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?
 
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)
 
Back
Top