} // end method /// <summary> /// Logs an audit log entry. Checks if should be logged /// by looking up the filters. /// </summary> /// <param name="auditEvent">Event to log</param> public static void Audit(AuditEventBase auditEvent) { if (CoreGlobals.AppPreferences != null && CoreGlobals.AppPreferences.AuditLogEnable) { bool doAudit = false; String eventName = auditEvent.EventType.ToLower().Trim(); if (_enableAll) { if (!_disableFilter.Contains(eventName)) { doAudit = true; } } else { if (_enableFilter.Contains(eventName)) { doAudit = true; } } if (doAudit) { lock (ObjSync) { var sw = new StreamWriter(LogFileFullPath, true); sw.WriteLine(auditEvent.ToString()); sw.Flush(); sw.Close(); } } } }
/// <summary> /// Logs an audit log entry. Checks if should be logged /// by looking up the filters. /// </summary> /// <param name="auditEvent">Event to log</param> public static void Audit(AuditEventBase auditEvent) { if (CoreGlobals.AppPreferences != null && CoreGlobals.AppPreferences.AuditLogEnable) { bool doAudit = false; String eventName = auditEvent.EventType.ToLower().Trim(); if (_enableAll) { if (!_disableFilter.Contains(eventName)) { doAudit = true; } } else { if (_enableFilter.Contains(eventName)) { doAudit = true; } } if (doAudit) { lock (ObjSync) { var sw = new StreamWriter(LogFileFullPath, true); sw.WriteLine(auditEvent.ToString()); sw.Flush(); sw.Close(); } } } }