/// <summary> /// Return the severity as a textual representation /// </summary> /// <param name="severity"></param> /// <returns>Textual representation of the severity</returns> protected String GetSeverityText(SEVERITY severity) { String severityText; switch (severity) { case SEVERITY.INFORMATION: severityText = "[INFORMATION]"; break; case SEVERITY.SUCCESS: severityText = "[SUCCESS]"; break; case SEVERITY.FAILURE: severityText = "[FAILURE]"; break; case SEVERITY.ERROR: severityText = "[ERROR]"; break; default: severityText = "[UNKNOWN]"; break; } return(severityText); }
private void LogRecent(string name = "", string message = "", SEVERITY severity = SEVERITY.INFO) { string serv = Enum.GetName(typeof(SEVERITY), severity); string dest = $"recent:{name}:{serv}"; string msg = DateTime.Now + " " + message; command.ListLeftPush(dest, msg); command.ListTrim(dest, 0, 100); }
public void LogInfo(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring) { this.Invoke("LogInfo", new object[] { ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring }); }
public void LogInfoWithMsgID(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, int MessageID) { this.Invoke("LogInfoWithMsgID", new object[] { ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring, MessageID }); }
public void LogInfoWithOverride(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, string OverrideSubjectLine, string OverrideEMailFrom, string OverrideEMailTo) { this.Invoke("LogInfoWithOverride", new object[] { ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring, OverrideSubjectLine, OverrideEMailFrom, OverrideEMailTo }); }
/// <remarks/> public void LogInfoAsync(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, object userState) { if ((this.LogInfoOperationCompleted == null)) { this.LogInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogInfoOperationCompleted); } this.InvokeAsync("LogInfo", new object[] { ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring }, this.LogInfoOperationCompleted, userState); }
public void logToFile(SEVERITY type, DateTime timeStamp, String msg) { StringBuilder sb = new StringBuilder(); sb.Append(timeStamp.ToLongTimeString()).Append(": ").Append(type.ToString()).Append(" ").Append(this.StackTrace); try { StreamWriter sw = new StreamWriter(path+"/"+SQLLOG, true); sw.WriteLine(sb.ToString()); sw.Close(); } catch (Exception) { } }
/// <remarks/> public void LogInfoWithOverrideAsync(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, string OverrideSubjectLine, string OverrideEMailFrom, string OverrideEMailTo, object userState) { if ((this.LogInfoWithOverrideOperationCompleted == null)) { this.LogInfoWithOverrideOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogInfoWithOverrideOperationCompleted); } this.InvokeAsync("LogInfoWithOverride", new object[] { ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring, OverrideSubjectLine, OverrideEMailFrom, OverrideEMailTo }, this.LogInfoWithOverrideOperationCompleted, userState); }
private void init(FACILITY _f, SEVERITY _s) { Month[1] = "Jan "; Month[2] = "Feb "; Month[3] = "Mar "; Month[4] = "Apr "; Month[5] = "May "; Month[6] = "Jun "; Month[7] = "Jul "; Month[8] = "Aug "; Month[9] = "Sep "; Month[10] = "Oct "; Month[11] = "Nov "; Month[12] = "Dec "; port = 514; server = ""; facility = _f; severity = _s; }
/// <summary> /// Constructor which accepts a pipe separated text string /// </summary> /// <param name="message"></param> public AuditTrailMessage(String message) { String[] msgParts = message.Split('|'); try { if (msgParts.Length == 3) { _date = DateTime.Parse(msgParts[0]); _severity = SeverityValue(msgParts[1]); _message = msgParts[2]; } else { throw new Exception(); } } catch (Exception) { _severity = SEVERITY.INFORMATION; _message = ""; _date = DateTime.Now; } }
public AuditTrailMessage(SEVERITY severity, String message) { _severity = severity; _message = message; _date = DateTime.Now; }
public bool GetAppInfo(int ApplicationID, out bool AlertAllowed, out bool EMailAllowed, out bool LogAllowed, out SEVERITY AppSeverity) { object[] results = this.Invoke("GetAppInfo", new object[] { ApplicationID }); AlertAllowed = ((bool)(results[1])); EMailAllowed = ((bool)(results[2])); LogAllowed = ((bool)(results[3])); AppSeverity = ((SEVERITY)(results[4])); return((bool)(results[0])); }
public FSXException(FSXFAILURE f, SEVERITY s) { _f = f; _sev = s; }
/// <remarks/> public void LogInfoWithMsgIDAsync(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, int MessageID) { this.LogInfoWithMsgIDAsync(ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring, MessageID, null); }
public static void Log(String mex, SEVERITY s) { throw new NotImplementedException(); }
public Syslog(FACILITY _facility, SEVERITY _severity) { init(_facility, _severity); }
/// <remarks/> public void LogInfoWithOverrideAsync(int ApplicationID, SEVERITY LogSeverity, string Message, string ServerName, string AdditionalDatastring, string OverrideSubjectLine, string OverrideEMailFrom, string OverrideEMailTo) { this.LogInfoWithOverrideAsync(ApplicationID, LogSeverity, Message, ServerName, AdditionalDatastring, OverrideSubjectLine, OverrideEMailFrom, OverrideEMailTo, null); }