private void LogRespons(string api, string operation, System.Diagnostics.Stopwatch stopwatch, TestOperationResponse response) { var responseAsJson = _jsonSerializer.ToJson(response, Formatting.Indented); using (Serilog.Context.LogContext.PushProperty("Respons", responseAsJson, true)) { Log.Here().Information("Respons: {@Api} {@Operation} in {Elapsed:0.0000} ms.", api, operation, stopwatch.Elapsed.TotalMilliseconds); } }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { TestOperationResponse response = new TestOperationResponse(); return(response); }
private void LogRespons(string service, string operation, System.Diagnostics.Stopwatch stopwatch, TestOperationResponse response) { var responsAsXml = _xmlSerializer.ToXml(response); using (Serilog.Context.LogContext.PushProperty("Respons", responsAsXml, true)) { Log.Here().Information("Respons: {@Api} {@Operation} in {Elapsed:0.0000} ms.", service, operation, stopwatch.Elapsed.TotalMilliseconds); } }
protected void WhenRequestIsHandled() => Response = Task.Run(async() => await GetAsync(Request)).Result;