Skip to content
phachon edited this page Jun 6, 2018 · 2 revisions

Log Api

1. Log Search

  • Path: /log/search?
  • Request: HTTP
  • Method: GET
  • Auth Token: true -> How to pass token?
  • Params:
name type required description comment
number int true log lines number
keyword string true log search keyword
level string true log level string "info", "error", "debug", default "" is all level
  • Success:
{
    "code": 1,
    "message": "success",
    "data": [
         "{\"timestamp\":1527762161,\"timestamp_format\":\"2018-05-31 18:22:41\",\"millisecond\":1527762161406,\"millisecond_format\":\"2018-05-31 18:22:41.406\",\"level\":6,\"level_string\":\"Info\",\"body\":\"Init QMessage file success!\",\"file\":\"main.go\",\"line\":40,\"function\":\"main.initQMessage\"}",// a line of the log
         "{\"timestamp\":1527762161,\"timestamp_format\":\"2018-05-31 18:22:41\",\"millisecond\":1527762161406,\"millisecond_format\":\"2018-05-31 18:22:41.406\",\"level\":6,\"level_string\":\"Info\",\"body\":\"Init QMessage file success!\",\"file\":\"main.go\",\"line\":40,\"function\":\"main.initQMessage\"}" // a line of the log
    ]
}
  • Failed:
{
    "code": 0,
    "message": "error",
    "data": []
}

2. Log list

all log file list

  • Path: /log/list?
  • Request: HTTP
  • Method: GET
  • Auth Token: true -> How to pass token?
  • Params:
  • Success:
{
    "code": 1,
    "message": "success",
    "data": [
         "error.log",
         "info.log",
         "access.log"
    ]
}
  • Failed:
{
    "code": 0,
    "message": "error",
    "data": []
}

3. Log download

all log file list

  • Path: /log/download?
  • Request: HTTP
  • Method: GET
  • Auth Token: false
  • Params:
name type required description comment
filename string true log filename
  • Success: download success
  • Failed:
{
    "code": 0,
    "message": "error",
    "data": []
}