The logs command retrieves the specified number of the most recent lines from the function's logs.

JSON Input Data Format
{
    "id": string,
    "lastlines": integer
}
id * Specifies the ID of the Serverless.
lastlines * Specifies the number of the last lines to be retrieved from the logs.
* Indicates a mandatory field.

Code Snippets
Here are several code snippets provided for your direct use. Simply select your preferred tool/language by clicking on it.


Successful Response
{
    "result": "OK",
    "payload": [
        {
            "log": "2024-08-22 08:39:07.409 [1724315946783318/join/4 (pid 32)] b_process is 2\n",
            "stream": "stdout",
            "time": "2024-08-22T08:39:07.885138425Z"
        },
        {
            "log": "2024-08-22 08:39:07.409 [1724315946783318/join/4 (pid 32)] total is 3\n",
            "stream": "stdout",
            "time": "2024-08-22T08:39:07.885139672Z"
        },
        ...
    ]
}

Failed Response
{
    "result": "ERR",
    "message": "Error message ..."
}