LogEvent.ErrorMessages

Topics: Logging Application Block
Aug 25, 2011 at 4:36 PM

How do you get the value of the LogEvent.ErrorMessages property to appear in a logfile?

I'm using the LogEntry.AddErrorMessage() method to add additional messages that I want logged, but they don't show up in my text log.

My formatter is configured like so:

         <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            template="{timestamp(local:FixedFormatTime)}|{win32ThreadId}|{category}|{priority}|{severity}|{dictionary({value}|)}{message}"
              name="Default Text Formatter" />

Thanks
Aug 26, 2011 at 5:14 AM

Hi,

Just simply add {errorMessages} token to your formatter and the error messages will be displayed.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
Contact Us

 

Aug 26, 2011 at 2:45 PM

Thanks, I guess I didn't see that token in the documentation anywhere.