Logging Application Block - Retrieving Additional Context Information

Topics: Logging Application Block
Apr 21, 2010 at 3:29 PM

Does anyone have any suggestions regarding a best practice for retrieving additional properties stored in the formattedmessage field? My development team has been stuffing additional info (outside of the default columns) into the formattedmessage field, in xml format, for reporting at a later time. However, we are having a very difficult time extracting it. How are others accomplishing this task?

Apr 22, 2010 at 3:53 AM

Hi mcass20,

Can you provide more details how you add additional properties in your FormattedMessage column?

Is the application retrieving the values a separate application from the one that logs the entry? If it is, then for me, going directly into the database will be enough.

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

 

Apr 23, 2010 at 1:04 AM
Yes, we build an xml document with the following structure:

<Property>
<Key>somekey1</Key>
<Value>somevalue1</Value>
<Key>somekey2</Key>
<Value>somevalue2</Value>
<Key>somekey3</Key>
<Value>somevalue3</Value>
</Property>

And then add that to the extendedproperties column of the logging table.

Its easy to store all the additional contextual info in the table but we can't come up with an elegant flexible solution to retrieve it for reporting purposes because there are many different web apps sharing the same logging table and each storing a different number of kv pairs.

Any suggestion would be greatly appreciated. We were crossing our fingers that EntLib 5 would offer some solution OOTB.


On Wed, Apr 21, 2010 at 11:53 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

Hi mcass20,

Can you provide more details how you add additional properties in your FormattedMessage column?

Is the application retrieving the values a separate application from the one that logs the entry? If it is, then for me, going directly into the database will be enough.

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

 

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Apr 23, 2010 at 2:45 AM

You could probably create a regular expression that will match the extended properties from the FormattedMessage column and then parse it to an xml.  From there, you could iterate through the nodes, you need not know specifically what are the keys inside or how many are there.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Apr 26, 2010 at 8:36 PM
Thanks for that suggestion. I'll try that and get back to you if I have any questions.

On Thu, Apr 22, 2010 at 10:46 PM, AvanadeSupport <notifications@codeplex.com> wrote:

From: AvanadeSupport

You could probably create a regular expression that will match the extended properties from the FormattedMessage column and then parse it to an xml.  From there, you could iterate through the nodes, you need not know specifically what are the keys inside or how many are there.

 

Sarah Urmeneta


Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com