void LogError(TraceSeverity Level, Exception exception)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string errorMessage = exception.Message + "--" + exception.StackTrace;
SPDiagnosticsService.Local.WriteTrace(0,
new SPDiagnosticsCategory("Error Log", Level, EventSeverity.Error), TraceSeverity.Unexpected, errorMessage, null);
});
}
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
string errorMessage = exception.Message + "--" + exception.StackTrace;
SPDiagnosticsService.Local.WriteTrace(0,
new SPDiagnosticsCategory("Error Log", Level, EventSeverity.Error), TraceSeverity.Unexpected, errorMessage, null);
});
}