Logging Block timestamp problem

Topics: Exception Handling Application Block, Logging Application Block
Jun 13, 2009 at 3:25 AM

Below is an example of an exeption sent to me by the e-mail trace listener.  Notice the timestamp value just below my MachineName.  It's the incorrect time and appears to be utc time zone.   The other date/time values in the message are appearing correctly.   This exception is also logged to a database using the database trace listener.  The TIMESTAMP value in the database is also incorrect.  My question is where is this timestamp value coming from.  My computers date/time is set correctly to Central Standard time.

 

Timestamp: 6/12/2009 7:10:16 PM
Message: HandlingInstanceID: 645c31c0-8b2f-4c10-93d6-75337371a64b
An exception of type 'System.Exception' occurred and was caught.
----------------------------------------------------------------
06/12/2009 19:10:15
Type : System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : This is a test Source : OnlineProducts Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void btnAdd_Click(System.Object, System.EventArgs)
Stack Trace :    at DirectWest.OnlineProducts.Forms.frmBundleDetails.btnAdd_Click(Object sender, EventArgs e) in C:\My Documents\Projects\DirectWest.OnlineProducts\DirectWest.OnlineProducts.Forms\frmBundleDetails.vb:line 72

Additional Info:

MachineName : KEVIN745VISTA
TimeStamp : 6/13/2009 1:10:15 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 AppDomainName : OnlineProducts.vshost.exe ThreadIdentity : DIRECTWEST\kevin.weir WindowsIdentity : DIRECTWEST\kevin.weir

Category: Errors
Priority: 0
EventId: 100
Severity: Error
Title: Enterprise Library Exception Handling
Machine: KEVIN745VISTA
Application Domain: OnlineProducts.vshost.exe Process Id: 5344 Process Name: C:\My Documents\Projects\DirectWest.OnlineProducts\DirectWest.OnlineProducts.Forms\bin\OnlineProducts.vshost.exe
Win32 Thread Id: 7044
Thread Name:
Extended Properties:

Jun 15, 2009 at 4:01 AM

The default timestamp used by LAB is the UTC time zone.  Use the {timestamp(local)} token to display the local time.

 

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.
entlib.support@avanade.com

Jun 15, 2009 at 5:28 AM

Thanks for response but you did not read my post carefully enough.

I am using {timestamp(local)} which is why the timestamp at top appears correctly.  The problem is with the timestamp appearing UNDER MACHINENAME.  There doesn't appear to be any way for me to correct this.  Is there a way to correct the timestamp that is appearing?

Additional Info:

MachineName : KEVIN745VISTA
TimeStamp : 6/13/2009 1:10:15 AM

Jun 15, 2009 at 7:18 AM

I apologize for that.  That information is from the ExceptionFormatter's AdditionalInformation property which, if you're going to look at the source code, returns collection of items including the Timestamp in UTC time zone.  There is no direct configuration using the configuration tool to do this but I think what you could do is to create your own exception formatter and override the required methods and the WriteAdditionalInfo(NameValueCollection attributes) method.  Look for the entry in the attributes variable with the key "TimeStamp" and format it accdg. to your desired timezone.

 

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.
entlib.support@avanade.com