Skip to content

Add http logs#810

Open
dmedov wants to merge 3 commits intorailwayapp:masterfrom
dmedov:codex/add_http_logs
Open

Add http logs#810
dmedov wants to merge 3 commits intorailwayapp:masterfrom
dmedov:codex/add_http_logs

Conversation

@dmedov
Copy link

@dmedov dmedov commented Mar 8, 2026

Summary

This adds HTTP request log support to railway logs and railway service logs.

Users can now query request logs from the CLI with the same workflow they already use for build and deploy logs, including filtering by Railway log query syntax and streaming live request traffic from an interactive terminal.

What changed

  • added --http to railway logs and railway service logs
  • added GraphQL query support for deployment HTTP logs
  • added plain-text and JSON formatting for HTTP log entries
  • added live follow support for HTTP logs
  • updated command help and examples
  • added parse coverage for the documented HTTP log example commands

Examples

railway logs --http --lines 50
railway logs --http --filter "@path:/api/users @httpStatus:200"
railway logs --http --json --filter "@requestId:abcd1234"
railway service logs --http --lines 10 --filter "@httpStatus:404"

@dmedov dmedov changed the title Codex/add http logs Add http logs Mar 8, 2026
@brody192 brody192 requested a review from Milo123459 March 9, 2026 15:29
@dmedov
Copy link
Author

dmedov commented Mar 13, 2026

@Milo123459 hello! could you check changes to support https logs, very useful for development via agents

Copy link
Collaborator

@Milo123459 Milo123459 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocked by previous comment. other then that, all good

filter: Option<String>,
on_log: impl Fn(queries::http_logs::HttpLogFields),
) -> Result<()> {
// HTTP log subscriptions currently return empty payloads for this backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think this is probably not the right approach- if we can use subscriptions we should. I'll have a look into it so we don't have to do a workaround like this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

Fixed this to use the subscription path instead of the polling workaround.

The HTTP logs subscription does work here, but it needed the subscription window args (anchorDate, afterDate, afterLimit) to behave like a live tail. I updated stream_http_logs to use that subscription shape and validated it against a real Railway service with fresh requests while the stream was attached

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've got this working locally using subscriptions. lmk if i should just push to this branch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, i think you could push your implementation also or check mine, let's just make it happen in any way 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello! could we merge?

@Milo123459 Milo123459 added the release/minor Author minor release label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants