Re: Why doesn't trace write timestamp?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Mon, 10 Apr 2006 07:09:45 +0100
Brett Romero <account@xxxxxxxxx> wrote:
I have this in an app.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" indentsize="2">
<listeners>
<add name="myListener" traceOutputOptions="Timestamp"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\TestConsole\MyListener.log"/>
</listeners>
</trace>
</system.diagnostics>
</configuration>
The code I'm using to write is this:
Debug.WriteLine("Hello config file.");
I just want to output variable values but also would like a time stamp
appended with every .Write or .WriteLine. First, what is the above
timestamp option doing (this came from intellisense) and how do I get
the behavior I'm looking for?
Having had a little experiment, it looks like this is only used when
you call Trace.TraceError, Trace.TraceInformation or Trace.TraceWarning
- not the Write* methods.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Why doesn't trace write timestamp?
- From: Brett Romero
- Re: Why doesn't trace write timestamp?
- References:
- Why doesn't trace write timestamp?
- From: Brett Romero
- Why doesn't trace write timestamp?
- Prev by Date: Re: regex help
- Next by Date: Re: regex help
- Previous by thread: Why doesn't trace write timestamp?
- Next by thread: Re: Why doesn't trace write timestamp?
- Index(es):
Relevant Pages
|