CorefinityCorefinityDocs
Open the Control PanelControl Panel
Logs · 15 of 25

Get lines around a site's log line

Answers one line with the lines before and after it in the same stream, each list oldest first. Name the line as <stream_id>,<time>, both taken from a line a search answered.

GET/api/corestack/sites/{site}/logs/context

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Query parameters

linestringRequired

The line, as <stream_id>,<time>. Up to 200 characters.

beforeinteger

How many earlier lines to answer. Defaults to 20. 0 to 100.

afterinteger

How many later lines to answer. Defaults to 20. 0 to 100.

environment_idinteger

The site row id of another environment of the same website to read instead of {site}. At least 1.

scopestring

env reads the one environment. site reads every environment of the website that you can see. Defaults to env.

envsite

Returns

200 The line and its neighbours.

Fields of the 200 answer
afterarray of objectsRequired

The later lines, oldest first.

Fields of each item
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

beforearray of objectsRequired

The earlier lines, oldest first.

Fields of each item
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

lineobjectRequired

One log line.

Fields
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
404line_not_foundThe log line is no longer available. Search again.
409logs_not_collectedLogs are not being collected for the environment yet. Try again later, or contact support.
409logs_rangeThe time range is outside the days logs are kept for. Choose a range inside the days the message names.
409logs_unavailableLogs could not be read, or are not collected for the site yet. Read the message; try again shortly.
409query_too_wideThe search covers too much. Choose a shorter range or a narrower search.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
503logs_busyLogs are busy at the moment. Try again in a few seconds.
503logs_cluster_unavailableLogs are not available at the moment. Try again shortly.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl 'https://manage.corefinity.com/api/corestack/sites/1042/logs/context?line=00000001000000006754af9632a2745e85c293e5aac08633%2C2026-11-03T09%3A53%3A00Z' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "after": [
    {
      "fields": {
        "level": "info",
        "method": "GET",
        "src": "nginx-access",
        "status": 200
      },
      "msg": "GET /products/4 200",
      "source": "web-access",
      "stream_id": "00000001000000006754af9632a2745e85c293e5aac08633",
      "time": "2026-11-03T09:54:00Z"
    }
  ],
  "before": [
    {
      "fields": {
        "level": "info",
        "method": "GET",
        "src": "nginx-access",
        "status": 200
      },
      "msg": "GET /products/2 200",
      "source": "web-access",
      "stream_id": "00000001000000006754af9632a2745e85c293e5aac08633",
      "time": "2026-11-03T09:52:00Z"
    }
  ],
  "line": {
    "fields": {
      "level": "info",
      "method": "GET",
      "src": "nginx-access",
      "status": 200
    },
    "msg": "GET /products/3 200",
    "source": "web-access",
    "stream_id": "00000001000000006754af9632a2745e85c293e5aac08633",
    "time": "2026-11-03T09:53:00Z"
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT