Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ITraceableComponent Interface

Represents a custom Reporting Services extension that can write trace messages to the report server trace log. 

Namespace:  Microsoft.ReportingServices.Extensions
Assembly:  Microsoft.ReportingServices.Diagnostics (in Microsoft.ReportingServices.Diagnostics.dll)
public interface ITraceableComponent

The ITraceableComponent type exposes the following members.

  NameDescription
Public methodSetTraceLogSets the handle to an ITraceLog object. The custom extension can use the ITraceLog object to write messages to the report server trace log.
Top

The following sample class demonstrates how to implement the ITraceableComponent interface to log an error message in the report server trace log.

public class CustomExtension : ITraceableComponent
{
   public void processSomething()
   {
      try
      {
         //Do something
      }
      catch(Exception e)
      {
         if (m_log != null && m_log.TraceError)
         {
            m_log.WriteTrace("CustomExtension:\r\n" + "An exception has occurred!", System.Diagnostics.TraceLevel.Error);
         }
      }
   }

   #region ITraceableComponent Members

   public void SetTraceLog(ITraceLog traceLog)
   {
      m_log = traceLog;
   }

   #endregion

   #region Member variables
   private ITraceLog m_log;
   #endregion
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.