How write to same file from two instance of the same application. For write I used TraceSource class with TraceEvent method from System.Diagnostis namespace. I try create method with Mutex for write, but my method don't work correctly. I can't find example for TraceSource logging with mutex. Can anybody help me?
My Log class:
public class LoggerTraceSource
{
private readonly TraceSource traceSource = new TraceSource();
public void InfoTraceEvent(string message, int level)
{
traceSource.TraceEvent(TraceEventType.Information, level, message);
}
}
In my application I used InfoTraceEvent for write to log file. How change InfoTraceEvent for threading write(write by two application instance)?