minbox-logging icon indicating copy to clipboard operation
minbox-logging copied to clipboard

log admin管理界面查看到的日志与后台打印的请求日志不符,如globalLogs等内容没有

Open randeexiong opened this issue 3 years ago • 1 comments

后台输出的日志内容

2022-09-17 22:25:07.918  INFO 24376 --- [io-1224-exec-10] o.m.f.l.a.l.ReportLogJsonFormatListener  : Receiving Service: 【cbrc-statment-verify-services -> 192.168.221.2】, Request Log Report,Logging Content:[ {
  "traceId" : "602654081907957760",
  "spanId" : "602654081907957760",
  "parentSpanId" : null,
  "requestUri" : "/httpTest/testCustTranInfoService",
  "requestMethod" : "POST",
  "httpStatus" : 200,
  "requestIp" : "0:0:0:0:0:0:0:1",
  "serviceIp" : "192.168.221.2",
  "servicePort" : "1989",
  "startTime" : 1663424707706,
  "endTime" : 1663424707761,
  "timeConsuming" : 55,
  "serviceId" : "cbrc-statment-verify-services",
  "requestHeaders" : {
    "content-length" : "0",
    "postman-token" : "fb90869b-8868-4e20-b96f-3b8e30b93456",
    "host" : "localhost:1989",
    "content-type" : "application/json",
    "connection" : "keep-alive",
    "accept-encoding" : "gzip, deflate, br",
    "user-agent" : "PostmanRuntime/7.29.0",
    "accept" : "*/*"
  },
  "requestParam" : "{}",
  "requestBody" : "",
  "responseHeaders" : { },
  "responseBody" : "",
  "exceptionStack" : null,
  "globalLogs" : [ {
    "level" : "info",
    "content" : "test",
    "exceptionStack" : null,
    "callerClass" : "org.minbox.framework.api.boot.cbrc.stateverify.service.CustTranInfoService",
    "callerMethod" : "findTranInfoByParams",
    "callerCodeLineNumber" : 56,
    "createTime" : 1663424707707
  } ]
} ]

logging admin web页面查看到的显示日志内容

{
    "spanId": "602654081907957760",
    "parentSpanId": null,
    "requestIp": "0:0:0:0:0:0:0:1",
    "serviceIp": "192.168.221.2",
    "servicePort": "1989",
    "startTime": 1663424707706,
    "endTime": 1663424707761,
    "requestHeaders": null,
    "requestParam": "{}",
    "requestBody": "",
    "responseHeaders": null,
    "responseBody": "",
    "exceptionStack": null,
    "globalLogs": null,
    "requestHeader": "{\"content-length\":\"0\",\"postman-token\":\"fb90869b-8868-4e20-b96f-3b8e30b93456\",\"host\":\"localhost:1989\",\"content-type\":\"application/json\",\"connection\":\"keep-alive\",\"accept-encoding\":\"gzip, deflate, br\",\"user-agent\":\"PostmanRuntime/7.29.0\",\"accept\":\"*/*\"}",
    "responseHeader": "{}"
}

randeexiong avatar Sep 17 '22 14:09 randeexiong

看了下源代码,org.minbox.framework.logging.admin.storage.LoggingDataSourceStorage#insertLog 有些日志请求没有写入到数据库中,比如globalLogs就没有写入,所以看到的才不同,是有什么考虑吗?

randeexiong avatar Sep 17 '22 14:09 randeexiong