Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diagnostics.Trace across multiple domains

I didn't find information about how Trace and TraceListener work across multiple domains.

Does the calling of Trace.WriteLine use the same instance across multiple domains or it creates its own Trace class instance on each domain?

In other words..can i use Trace.Write in multi-threaded or multi-domain app and don't care about potential synch problems: races in writing to the same file from different domains e.t.c?

like image 581
void Avatar asked Dec 07 '25 06:12

void


2 Answers

Each appDomain uses own instance of static class therefore i am can't use Trace.Write across multiple domains.

like image 53
void Avatar answered Dec 08 '25 21:12

void


I came across this nice post which may suggest a way forward:

http://philsversion.com/2009/05/14/how-to-use-debugwrite-and-tracewrite-across-app-domain-boundries/

All credit to the original author.

like image 33
cristobalito Avatar answered Dec 08 '25 21:12

cristobalito



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!