The SharePoint Unified Logging Service (ULS) provides support and debugging capabilities for both ops and developers. Understanding how to read the logs is an important first step to resolving issues.
Microsoft provides the ULS Viewer to help read old logs and logs that are currently being written to as the farm is running. It can also filter and apply formatting to logs to help narrow down a problem.
To isolate an issue, it is helpful to only look at a particular correlation id. Each correlation id is associated with a request or end to end action of the system (such as a time jobber). If there is a problem with a web page being rendered, locating the request in the ULS logs and isolating it to the specific correlation id removes all the noise from the other logs, helping to pinpoint the problem.
One way to figure add logging and some performance monitoring is to add SPMonitoredScope to your code.
using (new SPMonitoredScope("Feature Monitor"))
{
// My code here
}
This code will log the beginning and end of your requests as well as some performance data. Building your own custom monitor that implements ISPScopedPerformanceMonitor allows you to set the trace level or maximum execution time for a set of code.