public void Log(Guid logId, HttpContext context, Exception exception = null, IDictionary <string, string> additionalData = null) { try { var errorModel = ErrorModelCreator.Create(logId, context, exception, additionalData); var json = JsonConvert.SerializeObject(errorModel, _serializationSettings); _webClient.UploadString(_postUrl, "POST", json); } catch (Exception e) { } }
public override string Log(Error error) { if (error == null) { throw new NullReferenceException("error"); } var model = ErrorModelCreator.Create(error, _logId); var client = new MonitorrClient(); client.Log(model); return(model.Guid); }