Custom trace listener

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
 
G

Guest

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
 
A

alx

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"?
 
G

Guest

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
 
A

alx

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'.
 
A

alx

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top