Only log messages using logging handler

Topics: Logging Application Block
Apr 15, 2011 at 2:46 PM


I'm new to EntLib. I have a config file that contains exception block and loging block. There are 2 catagories in logging block, both with flat file listenser, one used for exception, the other for logging. For the logging, I just want to log the messages from the code, like parameters, status.. but now I have whole bunch of other infor that I don't need. The current log like this:

Status Log Information: 0 : Timestamp: 4/15/2011 1:39:05 PM
Message: zoom button pressed.
Category: Status Log
Priority: -1
EventId: 0
Severity: Information
Machine: 1528VS-ARCGIS10
App Domain: DefaultDomain
ProcessId: 9120
Process Name: C:\Program Files (x86)\ArcGIS\Desktop10.0\Bin\ArcMap.exe
Thread Name:
Win32 ThreadId:6280
Extended Properties:

What I realy need is just the 2nd line without "Message:". How can I do this? Thanks!


Apr 15, 2011 at 5:38 PM
Edited Apr 16, 2011 at 8:01 AM


On your logging category you can see a section called Log Message Formatter which uses a Text Formatter. Edit the Template there by clicking the ellipsis button, the Template Editor will appear. You can now add and remove labels as well as tokens. In your case, just leave out the {message} token and then remove the rest.


Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.