public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data) { var entry = (LogEntry)((ICloneable)data).Clone(); entry.Title = SanatizeTitle(entry.Title); var stackifyEvent = Translate(eventType, entry); StackifyLogger.QueueLogObject(stackifyEvent); }
/// <summary> /// Used to send errors directly via our API and not through a logging framework /// </summary> /// <param name="apikey"></param> public void SendToStackify(string apikey = null) { try { //So it can't happen twice. if (!_Sent) { if (this._Exception != null && IgnoreError(this._Exception)) { StackifyAPILogger.Log("Not sending error because it is being ignored. Error Type: " + this._Exception.GetType()); return; } _Sent = true; if (!Logger.ErrorShouldBeSent(this)) { return; } if (!Logger.CanSend()) { return; } LogMsg msg = null; if (_InternalLogMsg != null) { msg = _InternalLogMsg; } else { msg = new LogMsg(); } msg.Level = "ERROR"; msg.Ex = this; msg.Msg = this.ToString(); Logger.QueueLogObject(msg, null); _Sent = true; } } catch (Exception e) { StackifyAPILogger.Log(e.ToString()); } }