c# changing console color not working exactly in multithreaded applications
<p>I am working on multithreaded application(a server) which is basically a console application. In which I show processing log to console which is by default in white color.
but on successful transaction I show the text in green and on unsuccessful transaction I show text in red. So I have three separate function in Program.cs for this.</p>

<p>For simple log</p>

<pre><code>public static void Write(string text)
{
        try
        {
            Console.Out.Write(text);
        }
        catch (Exception)
        { }
    }
</code></pre>

<p>For unsuccessful transaction I change color to red, then print and then back to white</p>

<pre><code>    public static void WriteError(string text)
    {
        Console.ForegroundColor = ConsoleColor.Red;
        Console.WriteLine("\t" + text);
        Console.ForegroundColor = ConsoleColor.White;
    }
</code></pre>

<p>For successful Transaction I change color to green, then print and then back to white</p>

<pre><code>    public static void WriteSuccess(string text)
    {
        Console.ForegroundColor = ConsoleColor.Green;
        Console.WriteLine("\t" + text);
        Console.ForegroundColor = ConsoleColor.White;

    }
</code></pre>

<p>The problem is when more than 200 clients connected and the log of transactions of each client is printing on console. And when I change color like green for single line it cause many other lines of normal log to green as well. 
So please tell me how can I solve this problem. Thanks</p>
