environment_logs
Creates, updates, deletes, gets or lists an environment_logs resource.
Overview​
| Name | environment_logs |
| Type | Resource |
| Id | railway.observability.environment_logs |
Fields​
The following fields are returned by SELECT queries:
- list
One row per Log. The result of a logs query.
| Name | Datatype | Description |
|---|---|---|
attributes | array | The attributes that were parsed from a structured log |
message | string | The contents of the log message |
severity | string | The severity of the log message (eg. err) |
tags | object | The tags that were associated with the log |
timestamp | string | The timestamp of the log message in format RFC3339 (nano) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | environment_id | after_date, after_limit, anchor_date, before_date, before_limit, filter | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
environment_id | string | |
after_date | string | Latest date to look for logs after the anchor. |
after_limit | integer | Limit the number of logs returned after the anchor. |
anchor_date | string | Target date time to look for logs. |
before_date | string | Oldest date to look for logs before the anchor. |
before_limit | integer | Limit the number of logs returned before the anchor. |
filter | string | Filter logs using a query syntax. |
SELECT examples​
- list
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 }}'
;