How we can write exception errors in SharePoint Default logs..
SharePoint default logs, you can find under 14 hive /logs folder.
private void WriteToSPLog(string source, TraceSeverity traceSeverity, EventSeverity eventSeverity, string message)
{
SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(source, traceSeverity, eventSeverity), traceSeverity, message, null);
}
And this is how I called this function:
WriteToSPLog("MyR&D APP" , TraceSeverity.High , EventSeverity.Error , error);