Browse Source

打印日志

master
qian 3 months ago
parent
commit
9b4215c5ef
  1. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/PostService/PostService.cs

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.Agent/PostService/PostService.cs

@ -47,7 +47,9 @@ namespace Win_in.Sfs.Scp.WebApi.Agent
Serilog.Log.Information(url); Serilog.Log.Information(url);
Serilog.Log.Debug(content); Serilog.Log.Debug(content);
var response = await client.PostAsync(url, httpContent); var response = await client.PostAsync(url, httpContent);
Serilog.Log.Debug("输出响应内容");// 输出响应内容
Serilog.Log.Debug(response.ToString());// 输出响应内容
Console.WriteLine(response.ToString());
try try
{ {
Log.Debug("before EnsureSuccessStatusCode() response content↓↓↓"); Log.Debug("before EnsureSuccessStatusCode() response content↓↓↓");
@ -64,6 +66,8 @@ namespace Win_in.Sfs.Scp.WebApi.Agent
HttpContent respCon = response.Content; HttpContent respCon = response.Content;
string resultContent = await respCon.ReadAsStringAsync(); string resultContent = await respCon.ReadAsStringAsync();
Serilog.Log.Debug(resultContent.ToString());
Console.WriteLine(resultContent.ToString());
resultContent = resultContent.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""); resultContent = resultContent.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
Serilog.Log.Debug("response content↓↓↓"); Serilog.Log.Debug("response content↓↓↓");

Loading…
Cancel
Save