Skip to main content

environment_logs

Creates, updates, deletes, gets or lists an environment_logs resource.

Overview​

Nameenvironment_logs
TypeResource
Idrailway.observability.environment_logs

Fields​

The following fields are returned by SELECT queries:

One row per Log. The result of a logs query.

NameDatatypeDescription
attributesarrayThe attributes that were parsed from a structured log
messagestringThe contents of the log message
severitystringThe severity of the log message (eg. err)
tagsobjectThe tags that were associated with the log
timestampstringThe timestamp of the log message in format RFC3339 (nano)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectenvironment_idafter_date, after_limit, anchor_date, before_date, before_limit, filterFetch logs for a project environment. Build logs are excluded unless a snapshot ID is explicitly provided in the filter. Backed by the Railway GraphQL query environmentLogs.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstring
after_datestringLatest date to look for logs after the anchor.
after_limitintegerLimit the number of logs returned after the anchor.
anchor_datestringTarget date time to look for logs.
before_datestringOldest date to look for logs before the anchor.
before_limitintegerLimit the number of logs returned before the anchor.
filterstringFilter logs using a query syntax.

SELECT examples​

Fetch logs for a project environment. Build logs are excluded unless a snapshot ID is explicitly provided in the filter. Backed by the Railway GraphQL query environmentLogs.

SELECT
attributes,
message,
severity,
tags,
timestamp
FROM railway.observability.environment_logs
WHERE environment_id = '{{ environment_id }}' -- required
AND after_date = '{{ after_date }}'
AND after_limit = '{{ after_limit }}'
AND anchor_date = '{{ anchor_date }}'
AND before_date = '{{ before_date }}'
AND before_limit = '{{ before_limit }}'
AND filter = '{{ filter }}'
;