Get FE log file

Request

HEAD /api/get_log_file

GET /api/get_log_file

Description

Users can obtain FE log files through the HTTP interface.

The HEAD request is used to obtain the log file list of the specified log type. GET request is used to download the specified log file.

Path parameters

None

Query parameters

  • type

    Specify the log type. The following types are supported:

    • fe.audit.log:FE 审计日志
  • file

    Specify file name

Request body

None

Response

  • HEAD

    1. HTTP/1.1 200 OK
    2. file_infos: {"fe.audit.log":24759,"fe.audit.log.20190528.1":132934}
    3. content-type: text/html
    4. connection: keep-alive

    The returned header lists all current log files of the specified type and the size of each file.

  • GET

    Download the specified log file in text form

Examples

  1. Get the log file list of the corresponding type

    1. HEAD /api/get_log_file?type=fe.audit.log
    2. Response:
    3. HTTP/1.1 200 OK
    4. file_infos: {"fe.audit.log":24759,"fe.audit.log.20190528.1":132934}
    5. content-type: text/html
    6. connection: keep-alive

    In the returned header, the file_infos field displays the file list and the corresponding file size (in bytes) in json format

  2. Download log file

    1. GET /api/get_log_file?type=fe.audit.log&file=fe.audit.log.20190528.1
    2. Response:
    3. < HTTP/1.1 200
    4. < Vary: Origin
    5. < Vary: Access-Control-Request-Method
    6. < Vary: Access-Control-Request-Headers
    7. < Content-Disposition: attachment;fileName=fe.audit.log
    8. < Content-Type: application/octet-stream;charset=UTF-8
    9. < Transfer-Encoding: chunked
    10. ... File Content ...