Posts

Showing posts with the label event logger

Write an EventLog C# - SharePoint

# Create a new class called  Logger using System.Diagnostics;     public class Logger     {         string sSource;         string sLog;         public void EventLogWriter(string message)         {             SPSecurity.RunWithElevatedPrivileges(delegate()             {                 sSource = "SBS | Credit Approval";                 sLog = "Application";             if (!EventLog.SourceExists(sSource))               ...