Logs

Search the project's stored logs: app output (runtime), build logs (build) or requests (http), newest first

Lines are kept as long as the plan says (Free 1 day, Pro 7 days, Business 30 days). One call reads a bounded part of the range; pass nextCursor to go on with older lines. Secret environment values are redacted in app and build lines; request lines hold no client address or query string. Needs logs:read.

get/projects/{projectId}/logs/search

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/projects/{projectId}/logs/search
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

projectIdstring uuid required

Query parameters

source'runtime' | 'build' | 'http'

runtime: the app's own output; build: build logs of deployments; http: requests the platform proxy served for the project's hostnames

fromstring date-time

oldest line to include; default: 24 hours ago, never before the plan keeps lines

tostring date-time

newest line to include; default: now

qstring

text to find (case does not matter); several words must all appear

level'all' | 'errors'

errors: error lines only (stderr/error words; 5xx for requests)

status'all' | '2xx' | '3xx' | '4xx' | '5xx'

requests only: the status class

deploymentIdstring uuid

build logs of one deployment

cursorstring

nextCursor of the previous page: continue with older lines

limitinteger

Response

Lines

nextCursorstring nullable required

pass as cursor for older lines; null when the whole range was searched

fromstring required

ISO-8601 timestamp

tostring required

ISO-8601 timestamp

retentionDaysinteger required

how long the project's plan keeps lines

scannedLinesinteger required
completeboolean required

false: the search stopped early (page full or time budget); nextCursor continues it

Changes

No recorded changes to this operation across all 1 revision of this API.