The following is in config file.
<formatters>
<add template="{timestamp} {severity} {category} {message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="SingleLineFormatter" />
</formatters>
which displays
31/05/2011 11:43:24 Information …
But there is no millisecond displayed which would be useful for perf instrumentation, anyone knows how to display? Thanks.
You can specify Standard or Custom
DateTimeFormat strings to the timestamp template token:This would output something like:
By default the DateTime will be in UTC time. If you wish to use local time then prefix the format string with “local:”. e.g.
{timestamp(local:MM/dd/yyyy HH:mm:ss.fffffff)}Also, if you are looking to log performance tracing of method entries and exits you may want to look at the
Tracerclass.