Pass array of strings to single LogEntry without concatination. Possible?

Topics: Logging Application Block
Feb 16, 2011 at 3:07 PM

I use Logging AB to log to the flat file. The problem is that my application is close to real-time and produce much log messages.. Some of them are the result of string formatting / concatination.. Is it some way to pass array of strings to single LogEntry for further writing them to the file without concatination?

Feb 17, 2011 at 6:13 AM

I'm afraid I'm a little confused with your question, do you mean the messages of your LogEntry object is getting concatenated with other messages? If you're looking for something like an array type property in the LogEntry you can utilize the ExtendedProperties collection property. Else if you would want to have more like a customize format of your Log Entry you can create your own Custom Log Entry Formatter. HTH.

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

Feb 17, 2011 at 1:57 PM
AvanadeSupport wrote:

I'm afraid I'm a little confused with your question, do you mean the messages of your LogEntry object is getting concatenated with other messages? If you're looking for something like an array type property in the LogEntry you can utilize the ExtendedProperties collection property. Else if you would want to have more like a customize format of your Log Entry you can create your own Custom Log Entry Formatter. HTH.

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

Hi,

what I mean is issue of performance.

Each call to string.Format("{0} {1} {2}", s1, s2, s3) aloccates new string(s).. I would like to minimize such allocations in logging part of application..

It would be ideal if fll parts of log message like: "{0} {1} {2}" from my example and other system features like {time} {threadId} etc. coould be ritten directly to IO without any intermediate strings.

Does EF5 meet my needs?

Feb 17, 2011 at 11:17 PM

If you have verified that the formatters is causing the performance issue, then I would suggest that you create your own custom formatter. 

 

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