Custom trace listener

  • Thread starter Thread starter alx
  • Start date Start date
A

alx

I want to create trace lister where one application (A) listening to
another application (B). Application A should attach to application B
and listening to events. Like SQL Profiler.

Early I have realized this scenario using COM+ loosely coupled events.
But maybe .NET have special mechanisms to do this.

Thanks
 
Hi,

You can create this behaviour putting the trace objects in a separete DLL
and publish them as static. So several applications can have access to them,
this is how SQL server profiler works.

cheers
Salva
 
Hi
You can create this behaviour putting the trace objects in a separete DLL
and publish them as static. So several applications can have access to them,
this is how SQL server profiler works.

Thanks for your answer, but what does it mean "publish them as static"?
 
Hi,

Publish the trace object as Static so all the instances share the same
object. I think is called "Shared" on VB.NET

public class yourTrece
{
private static ..... (your trace)

public static void Log (string text)
{
(yourTrace).WriteLine(Text)
}
}

So if you connect you can sneak what your trace object is doing.

Regards
Salva
 
Salvador said:
Hi,

Publish the trace object as Static so all the instances share the same
object. I think is called "Shared" on VB.NET

It doesn't work because applications are running in different processes
and each process loaded its own copy of the 'static dll'.
 
It doesn't work because applications are running in different processes
and each process load its own copy of the 'static dll'.
 
Back
Top