In Custom Components, you can use tracing if you reference the System.Web namespace and use the HttpContext.Current object to get a reference to the current context. Eg:
System.Web.HttpContext.Current.Trace("Application Trace Message", "Message");
Set the following directives:
For Page Level Tracing set Page Directive as
<%@ Page Trace="true" %>
For Application Level Tracing modify corresponding web.config as
<configuration>
<system.web>
<trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
</system.web>
</configuration>
Tracing in ASP.Net Custom Components
Hot on Web: