メインコンテンツ

GET Active Log

Get the active main log of the server

Since R2026a

Description

Use the GET method to read the server's active log. The active log is the main log currently being written to by the server. Uncomment the --log-endpoint property in the main_config file to enable the API.

For more information about enabling and using the API, see Read Active Log using API.

Request

HTTP Method

GET

URI

http://host:port/api/log

Response

Success

HTTP Status Code

200 OK

Body
LineDatetimeSeverityEntry
The line number of the entry in the log The date and time of the entry in YYYY:MM:DD HH:MM:SS format

The severity of the message (information, warning, error, or trace)

The log entry itself

Example:

1 [2025.03.18 13:50:49.510638] [information] Starting master (pid = 10676)
2 [2025.03.18 13:50:49.511635] [information] Global locale: en_US
3 [2025.03.18 13:50:49.511635] [information] Global encoding: UTF-8
4 [2025.03.18 13:50:49.511635] [information] terminal encoding: UTF-8
11 [2025.03.18 13:50:50.168347] [information] -- log directory: "L:\\server\\test_server\\log"
12 [2025.03.18 13:50:50.169334] [information] configuring WebFunction router
13 [2025.03.18 13:50:50.169334] [information] -- loading routes file: .\config\routes.json
122 [2025.03.18 13:50:51.419418] [information] -- UriPathRegexMatcher: removing old entries. operation=add, component=mps_check, entries=0, exists=false

Error

HTTP Status Code

403 Log Endpoint Disabled

404 Log Not Found

Sample Call

HTTP

Request:

GET /api/health HTTP/1.1
Host: localhost:9910

Response:

HTTP/1.1 200 OK

cURL

curl "http://localhost:9910/api/log"

Version History

Introduced in R2026a