Help to change the format of timestamp

Topics: Logging Application Block
Sep 24, 2008 at 3:36 PM
Edited Sep 24, 2008 at 6:44 PM
Hello,
I have a log file that is currently in the default format of

add template="Timestamp: {timestamp}
Message: {message}
Category: {category}
Priority: {priority}
EventId: {eventid}
Severity: {severity}
Title:{title}
Machine: {machine}
Application Domain: {appDomain}
Process Id: {processId}
Process Name: {processName}
Win32 Thread Id: {win32ThreadId}
Thread Name: {threadName}
Extended Properties: {dictionary({key} - {value}
)}"

 

 

 is there any way I can change the format of my log file to look like this:

[INFO ][2008-09-10 16:24:01,504][ContextImpl] 

I did figure out how to change the time to reflect my local time instead of UTC by writing my custom class, however I dont know how to set the formatted (string) time back to the log file's timestamp.


Any help will be appreciated.
Thanks

 

 

 

Sep 25, 2008 at 1:59 PM
Hi,

This should help http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=27629.

Fernando