Ejemplo n.º 1
0
 private LogMetadata BuildResponseMetadata(LogMetadata logMetadata, HttpResponseMessage response)
 {
     logMetadata.ResponseStatusCode  = response.StatusCode;
     logMetadata.ResponseTimestamp   = DateTime.Now;
     logMetadata.ResponseContentType = response.Content?.Headers.ContentType.MediaType;
     return(logMetadata);
 }
Ejemplo n.º 2
0
        private bool SendToLog(LogMetadata logMetadata)
        {
            // TODO: Write code here to store the logMetadata instance to a pre-configured log store...

            AppLog.Instance.Info(logMetadata.ToString());

            return(true);
        }
Ejemplo n.º 3
0
        private LogMetadata BuildRequestMetadata(HttpRequestMessage request)
        {
            LogMetadata log = new LogMetadata
            {
                RequestMethod    = request.Method.Method,
                RequestTimestamp = DateTime.Now,
                RequestUri       = request.RequestUri.ToString()
            };

            return(log);
        }