How to stop Logging if Error comes as ""There was an error reading from the pipe: The pipe has been ended. (109, 0x6d)."

Topics: Exception Handling Application Block, Logging Application Block
Jan 24, 2013 at 1:42 PM
Edited Jan 24, 2013 at 1:43 PM


I want to exclude some exceptions from login, for example If error comes as "There was an error reading from the pipe: The pipe has been ended. (109, 0x6d)." I don't want to log this.

Is there any way to exclude this exception from logging, My config section is as Follow:


    <section name="loggingConfiguration"
             type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=, Culture=neutral, PublicKeyToken=3afac4595eedae9b"/>

 <loggingConfiguration name="Logging Application Block"
      <add fileName="~\%ProgramData%\Logs\Error.Log"
           formatter="Text Formatter"
           listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=, Culture=neutral, PublicKeyToken=3afac4595eedae9b"
           type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=, Culture=neutral, PublicKeyToken=3afac4595eedae9b"


Please suggest me how to exclude this exception from EL logging.



Jan 28, 2013 at 12:09 AM

If you didn't want to log a specific exception message, you would have to check the exception Type and/or exception Message and not log it if you don't want to.

If the exception that you didn't want to log can be determined by type then you could use the Exception Handling Block to ignore that exception and log all other exceptions.  However, if it was just determined by the Message contained within the exception you would still have to create a custom Exception Handler.

Randy Levy
Enterprise Library support engineer
Support How-to 

Jan 28, 2013 at 5:13 AM

May i know, What will be the config file if i want to determine by message?

Jan 28, 2013 at 5:32 AM

There is no specific out of the box config file entry; you will have to check the exception Message in your code.  One way to do this would be to code a Custom Filter that checks the LogEntry Message (assuming that you are adding the Exception Message to the LogEntry Message property).  See Using Custom Filters in the Enterprise Library Logging Block for an example.  Also, this thread: might be useful if you choose to go down the filter path.

Randy Levy
Enterprise Library support engineer
Support How-to