Structured log format
reece
PROOP

10 months ago

The following log line is not being treated as structured, even though it ends with JSON:

I, [2025-09-05T17:30:43.630155 #10]  INFO -- : [ef7b78d4-9669-4c20-84c8-e0ce4d47cf8e] {"method":"GET","path":"/admin","format":"html","controller":"HomeController","action":"admin","status":200,"allocations":21343,"duration":305.67,"view":15.13,"db":244.58}

What am I doing wrong here?

Solved

6 Replies

jaredlunde
EMPLOYEE

10 months ago

The entire log has to be emitted as JSON for us to pick it up https://docs.railway.com/guides/logs#structured-logs


reece
PROOP

10 months ago

it seems to work e.g. with caddy - unless there's some trickery to make it only output JSON?

1413581276882927726

1413581277491237007


jaredlunde
EMPLOYEE

10 months ago

Caddy changes the output if it detects an interactive terminal (left) but it defaults to JSON (right)


reece
PROOP

10 months ago

ahhhhh


reece
PROOP

10 months ago

okay thanks


jaredlunde
EMPLOYEE

10 months ago

!s


Status changed to Solved jaredlunde 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...