Instant Logs is a lightweight and easy-to-use log service that allows you to view logs for Functions and Pages in real time in the console. You can use the data from Instant Logs to understand the execution status of your functions and make adjustments to Functions and Pages accordingly.
Limitations
Each Functions and Pages instance can have only one active monitoring window at a time. The maximum duration for a single monitoring session is 60 minutes.
Instant Logs can store a maximum of 40 records per session. Records are sorted in reverse chronological order, and new records overwrite the oldest ones when the buffer is full.
Start monitoring
Log on to the ESA console. In the left-side navigation pane, choose .
On the Edge Function page, click the name of the target function, or click View Details in the Actions column of the function.
Select to start collecting logs.
Click
to view the detailed fields for a specific log record.Click
in the upper-right corner to download the log data as a JSON file.If you switch function pages during monitoring, the monitoring is stopped and the history is cleared. You need to manually click Start Monitoring again to start Instant Logs.
Stop monitoring
Log on to the ESA console. In the left-side navigation pane, choose .
On the Edge Function page, click the name of the target function, or click View Details in the Actions column of the function.
Select , and click Stop Monitoring,
, or
to stop the monitoring window and log collection.NoteThe collected log history remains visible on the page. Clicking Start Monitoring again appends new logs to the history.
Fields
Field | Type | Description |
ClientRequestID | string | The unique ID of the main client request. |
LogTimestamp | Timestamp ISO8601 | The timestamp when the log event was generated, in ISO 8601 format. Example: 2024-01-01T00:00:00+08:00 |
SubRequestID | string | The unique ID of the sub-request. |
SubRequestStatus | int | The status of the sub-request. |
SubRequest2xxCount | int | The number of sub-requests that returned a 2xx status code. |
SubRequest3xxCount | int | The number of sub-requests that returned a 3xx status code. |
SubRequest4xxCount | int | The number of sub-requests that returned a 4xx status code. |
SubRequest5xxCount | int | The number of sub-requests that returned a 5xx status code. |
SubRequestOtherCount | int | The number of sub-requests that returned other status codes. |
CodeVersion | string | The version number of the code. |
ConsoleLog | string | Custom log messages generated by the |
CPUTime | int | The total CPU time consumed by the request, in microseconds. |
DurationTime | int | The total execution time of the request within the EdgeRoutine, including sub-request wait time and I/O time. Unit: milliseconds. |
ErrorCode | int | The error code for the code execution. A value of 0 indicates that no error occurred. |
ErrorMessage | string | The description of the error corresponding to the ErrorCode. |
EventType | string | The type of event that triggered the function. Currently, only HTTP events are supported. |
ResponseSize | int | The total size of the response, in bytes. |
ResponseStatus | int | The status code of the response. |
RoutineName | string | The function name. |
RoutineSpec | string | The specifications of the EdgeRoutine. |
ClientASN | string | The Autonomous System Number (ASN) resolved from the client IP address. |
ClientIP | string | The IP address of the client. |
ClientISP | string | The internet service provider (ISP) resolved from the client IP address. |
ClientProxyIP | string | The proxy IP address of the client. |
ClientRegionCode | string | The ISO 3166-2 code for the client's region, resolved from the client IP address. |
ClientSSLCipher | string | The SSL cipher suite used by the client. |
ClientSSLProtocol | string | The SSL protocol version used by the client. |
ClientSrcPort | int | The source port used by the client to connect to the node. |
ClientXRequestedWith | string | The value of the X-Requested-With HTTP header from the client request. |
ClientZoneCode | string | The ISO 3166-1 alpha-2 country code for the client's location, resolved from the client IP address. |
ClientRequestBytes | int | The size of the client request, in bytes. |
ClientRequestHeaderRange | string | The value of the Range field from the client request header. Example: bytes=0-100 |
ClientRequestHost | string | The host of the client request. |
ClientRequestMethod | string | The HTTP method of the client request. |
ClientRequestPath | string | The path of the client request. |
ClientRequestProtocol | string | The protocol of the client request. |
ClientRequestReferer | string | The referer of the client request. |
ClientRequestScheme | string | The scheme of the client request. |
ClientRequestURI | string | The URI of the client request. |
ClientRequestUserAgent | string | The user agent of the client request. |
EdgeResponseStatusCode | int | The status code that the ESA node returns to the client. |