Log entity object

Topics: Logging Application Block
Mar 17, 2010 at 6:17 PM

Assume u have a class with 3 properties and we are using policy injection with LogCallHandler

How do we write class properties in log file.?

Following is the scenario where i am facing problem...

i have defined following listner in logging block

 <listeners>

<add fileName="c:\trace.log" header="----------------------------------------"

footer="----------------------------------------" formatter="Text Formatter"

listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

name="FlatFile TraceListener" />

</listeners>

 and i have a class NotificationController with 3 attributes, now when i am calling following code

<font size="2">

objnotificationcontroller =

</font>

PolicyInjection.Create<NotificationController, INotificationController>();

objnotificationcontroller.PreparePDFDocument(objnewcase);

the log file (see below) contains nothing in Extended properrties. How do i write class object values in log.?

----------------------------------------
Timestamp: 03/17/2010 5:08:23 PM
Message: Before
Category: General
Priority: -1
EventId: 0
Severity: Information
Title:Call Logging
Machine: RAVIKIRAN
Application Domain: 837b3c9d-2-129133192864163613
Process Id: 3112
Process Name: C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.exe
Win32 Thread Id: 5136
Thread Name:
Extended Properties: newcase - ETFS.GEM.EntityLayer.NewCaseNotification

----------------------------------------

 

 

 

Mar 18, 2010 at 8:43 AM

Hi,

As far as I know, that is not supported by the out-of-the-box ent lib. There are just several additional properties that can be logged by the logging handler which is documented here ( http://msdn.microsoft.com/en-us/library/dd139901.aspx ).

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com