Exemplo n.º 1
0
        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)
            {
            }
        }
Exemplo n.º 2
0
        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);
        }