.net中简单的记录日志的办法
// add this log file to trace listeners
Trace.Listeners.Add( new TextWriterTraceListener( logName ) );
// set up trace to auto-flush
Trace.AutoFlush = true;
Trace.WriteLine("");
Trace.WriteLine( location + " : " );
Trace.Indent();
Trace.WriteLine( message );
Trace.Unindent();
Trace.Listeners.Add( new TextWriterTraceListener( logName ) );
// set up trace to auto-flush
Trace.AutoFlush = true;
Trace.WriteLine("");
Trace.WriteLine( location + " : " );
Trace.Indent();
Trace.WriteLine( message );
Trace.Unindent();