I have a snipnet which writes user name to trace.
Trace.WriteLine("Current User: " + userIdentity.Name);
How to read this information. I did good search in net, no luck. Can we read default trace?
Thank in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the default trace listener writes into Console.
you can see its output in the debugger using CTRL+W ,O
(View->Output)
you need a proper Trace listener
http://msdn.microsoft.com/en-us/library/system.diagnostics.tracelistener.aspx
when you use
Trace.WriteLine()all the trace listeners catch this and write
my personal favorite is XmlWriterTraceListener
just do like this
Trace.Listener.Add(new XmlTraceListener (tracefilepath));use
Trace.WriteLine()and watch how it creates a nice xml filethat can be easily viewed using Service Trace Viewer Tool (SvcTraceViewer.exe)