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: VB.NET
C#
Also make sure to set the following directives:
For Page Level Tracing set Page Directive as
For Application Level Tracing modify corresponding web.config as