Structured log format
reece
PROOP

6 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

6 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

6 months ago

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

1413581276882927600
1413581277491237000


jaredlunde
EMPLOYEE

6 months ago

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


reece
PROOP

6 months ago

ahhhhh


reece
PROOP

6 months ago

okay thanks


jaredlunde
EMPLOYEE

6 months ago

!s


Status changed to Solved jaredlunde 6 months ago


Loading...