Logging to a File - Formatting the Logging

Topics: Logging Application Block
Apr 27, 2009 at 3:19 PM

I have seen that the loggin to a file happens in a format like this: 
Timestamp: 4/27/2009 2:15:32 PM
Message: This is being written to text file
Category: Debug
Priority: 2
EventId: 4000
Severity: Information
Title:My Title
Application Domain: CLREntLib.exe
Process Id: 3112
Process Name: d:\Bhaskar\POC\NewEntLib_CLR\debug\CLREntLib.exe
Win32 Thread Id: 4388
Thread Name:
Extended Properties:

What do I have to do if I had to print my Logs this way:

Timestamp: 4/27/2009 2:15:32 PM, Message: This is being written to text file, Category: Debug, Priority: 2, EventId: 4000, Severity: Information, Title:My Title, Machine: , Application Domain: CLREntLib.exe, Process Id: 3112
Process Name: d:\Bhaskar\POC\NewEntLib_CLR\debug\CLREntLib.exe, Win32 Thread Id: 4388, Thread Name: , Extended Properties:

Basically, I just woulf like to change the way the log is being written to the file. PLease let me know if this can be done and how?

Thank You,

Apr 28, 2009 at 3:25 AM
You only need to change the Formatter's template.  You can easily do this by opening your configuration file in the EntLib Configuration Tool, go to your tracelistener's Formatter property. Expand it and you will see the template. 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.