Write an EventLog C# - SharePoint
{
string sSource;
string sLog;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
public void EventLogWriter(string message)
{
sSource = "Test System Name";
sLog = "Application";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
EventLog.WriteEntry(sSource, message, EventLogEntryType.Error, 1);
}
});
}
----------------------------- Regards : Shashika Hettiarachchi -----------------------------
Comments
Post a Comment