public static void send( HttpLogger logger, HttpRequest request, HttpResponse response, string response_body = null, string request_body = null, long now = 0, long interval = 0) { if (!logger.Enabled) { return; } // copy details from request & response List <string[]> message = HttpMessage.build(request, response, response_body, request_body); // TODO copy data from session if configured // if (logger.rules.copy_session_field.Count != 0) // { // } // add timing details if (now == 0) { now = DateTime.UtcNow.Subtract(DateTime.UnixEpoch).Ticks / TimeSpan.TicksPerMillisecond; } message.Add(new string[] { "now", now.ToString() }); if (interval != 0) { message.Add(new string[] { "interval", interval.ToString() }); } logger.SubmitIfPassing(message); }
public HttpLoggerForNET(RequestDelegate next) { _next = next; _logger = new HttpLogger(url: "http://localhost:4001/message", rules: "include debug\nskip_compression"); }