Standard PostgreSQL checkpoint logs categorized as errors in Railway logs

benbishHOBBY

3 months ago

Hello, this is pretty minor but Railway might be misinterpreting PostgreSQL logs. It appears that PostgreSQL checkpoint logs are being incorrectly categorized as errors in Railway.

It would be helpful to me when viewing the logs that these are properly categorized. e.g.

{
  "severity": "error",
  "timestamp": "2025-02-15T18:17:53.783360166Z",
  "message": "2025-02-15 18:17:46.457 UTC [59] LOG:  checkpoint starting: time",
  "tags": {
    "deploymentId": "xxx",
    "deploymentInstanceId": "xxx",
    "environmentId": "xxx",
    "pluginId": null,
    "projectId": "xxx",
    "serviceId": "xxx",
    "snapshotId": null
  },
  "attributes": {
    "level": "error"
  }
}

How can I resolve this? I am a PostgreSQL and Railway rookie.

Thanks very much!

Awaiting User Response

3 Replies

3 months ago

The Railway log severity is determined by the log level from the system producing the logs. In this case, PostgreSQL checkpoints are categorized an errors and colored red because Postgres sends the log to stderr.


Status changed to Awaiting User Response railway[bot] 3 months ago


benbishHOBBY

3 months ago

What would you recommend I do here? Is it possible to send them to stdout - is this worth the effort?


Status changed to Awaiting Railway Response railway[bot] 3 months ago


3 months ago

The colour is inconsequential to the behavior, but if you don't want to see red you can simply set a LOG_TO_STDOUT service variable to true on the Postgres database and all of its logs will be redirected to stdout.


Status changed to Awaiting User Response railway[bot] 3 months ago