Redirect Trace output to Console

You can add the following to your exe’s .config file. <?xml version=”1.0″?> <configuration> <system.diagnostics> <trace autoflush=”true”> <listeners> <add name=”logListener” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”cat.log” /> <add name=”consoleListener” type=”System.Diagnostics.ConsoleTraceListener”/> </listeners> </trace> </system.diagnostics> </configuration> I included the TextWriter as well, in case you’re interested in logging to a file.

How can I add (simple) tracing in C#? [closed]

I followed around five different answers as well as all the blog posts in the previous answers and still had problems. I was trying to add a listener to some existing code that was tracing using the TraceSource.TraceEvent(TraceEventType, Int32, String) method where the TraceSource object was initialised with a string making it a ‘named source’. For me … Read more

Logging best practices [closed]

Update: For extensions to System.Diagnostics, providing some of the missing listeners you might want, see Essential.Diagnostics on CodePlex (http://essentialdiagnostics.codeplex.com/) Frameworks Q: What frameworks do you use? A: System.Diagnostics.TraceSource, built in to .NET 2.0. It provides powerful, flexible, high performance logging for applications, however many developers are not aware of its capabilities and do not make … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)