1SPDiagnosticsService.Local.WriteTrace(0,new SPDiagnosticsCategory("YourProductName",TraceSeverity.Medium, EventSeverity.Warning),TraceSeverity.Medium, "Testing logging","klklklkl");
The above code will log to the sharepoint logs. It will be located in the following directory. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS To view the logs, use ulsviewer. you can download it from http://archive.msdn.microsoft.com/ULSViewer/Release/ProjectReleases.aspx?ReleaseId=3308