Esempio n. 1
0
        public void Send(GelfMessage message)
        {
            var msg           = _messageSerializer.SerializeToString(message);
            var stringContent = new StringContent(msg, System.Text.Encoding.UTF8);

            stringContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
            var response = _client.PostAsync(_uri, stringContent);

            if (response.Result.StatusCode == HttpStatusCode.Accepted)
            {
                throw new GraylogHttpTransportException($"Received status code '{response.Result.StatusCode}' from GrayLog.");
            }
        }