/// <summary> /// Default constructor. /// </summary> /// <param name="log">Indicates the log item</param> /// <param name="source">Indicates what logged the event</param> /// <param name="type"></param> public EventLog(string log, string source, EventLogWriterType type) { string logFileName = ""; string logPath = ""; //Setup the file and path if(logFileName.Length==0) { logFileName = Assembly.GetCallingAssembly().GetName().CodeBase + ".Log"; logFileName = logFileName.Substring(logFileName.LastIndexOf("\\")+1); } if(logPath.Length==0) { logPath = Assembly.GetCallingAssembly().GetName().CodeBase; logPath = Path.GetDirectoryName(logPath) + "\\"; } //Load the log file this.eventLogWriterType = type; this.CreateEventLogWriter(log, source, logPath, logFileName); }
/// <summary> /// Default constructor. /// </summary> /// <param name="log">Indicates the log item</param> /// <param name="source">Indicates what logged the event</param> /// <param name="type"></param> public EventLog(string log, string source, EventLogWriterType type) { string logFileName = ""; string logPath = ""; //Setup the file and path if (logFileName.Length == 0) { logFileName = Assembly.GetCallingAssembly().GetName().CodeBase + ".Log"; logFileName = logFileName.Substring(logFileName.LastIndexOf("\\") + 1); } if (logPath.Length == 0) { logPath = Assembly.GetCallingAssembly().GetName().CodeBase; logPath = Path.GetDirectoryName(logPath) + "\\"; } //Load the log file this.eventLogWriterType = type; this.CreateEventLogWriter(log, source, logPath, logFileName); }
/// <summary> /// Overloaded constructor /// </summary> /// <param name="log">Indicates the log item</param> /// <param name="source">Indicates what logged the event</param> /// <param name="path"></param> /// <param name="fileName"></param> /// <param name="type"></param> public EventLog(string log, string source, string path, string fileName, EventLogWriterType type) { //Load the log file this.eventLogWriterType = type; this.CreateEventLogWriter(log, source, path, fileName); }
/// <summary> /// Overloaded constructor /// </summary> /// <param name="log">Indicates the log item</param> /// <param name="source">Indicates what logged the event</param> /// <param name="path"></param> /// <param name="fileName"></param> /// <param name="type"></param> public EventLog(string log, string source,string path, string fileName, EventLogWriterType type) { //Load the log file this.eventLogWriterType = type; this.CreateEventLogWriter(log,source,path,fileName); }