Skip to content

feat(cli): add langgraph deploy logs subcommand#7100

Open
Vishnu Suresh (vishnu-ssuresh) wants to merge 17 commits intomainfrom
vishnu/cli-logs-command
Open

feat(cli): add langgraph deploy logs subcommand#7100
Vishnu Suresh (vishnu-ssuresh) wants to merge 17 commits intomainfrom
vishnu/cli-logs-command

Conversation

@vishnu-ssuresh
Copy link
Contributor

@vishnu-ssuresh Vishnu Suresh (vishnu-ssuresh) commented Mar 10, 2026

Add a langgraph deploy logs subcommand to fetch build and deploy/server logs from LangSmith deployments.

Changes

  • host_backend.py: Add get_build_logs() and get_deploy_logs() methods, plus langsmith_url support.
  • helpers.py (new): Log formatting (format_log_entry, format_timestamp, level_fg) and resolution helpers (resolve_deployment_id).

Usage

# Deploy logs (latest 10)
langgraph deploy logs --deployment-id <id> --limit 10

# Error logs by name
langgraph deploy logs --name gtm-agent --level ERROR

# Build logs
langgraph deploy logs --deployment-id <id> --type build

# Tail logs (Ctrl+C to stop)
langgraph deploy logs --name gtm-agent --follow

Tests

56 unit tests passing covering host backend methods, log formatting, and helper functions.

@vishnu-ssuresh Vishnu Suresh (vishnu-ssuresh) changed the title feat(cli): add langgraph logs command feat(cli): add langgraph deploy logs subcommand Mar 10, 2026
@hari-dhanushkodi hari-dhanushkodi force-pushed the vishnu/cli-logs-command branch from 79c06d6 to e0e999e Compare March 11, 2026 23:57
Copy link
Contributor

Choose a reason for hiding this comment

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

How come we're not using the offset/next_offset pagination for tailing logs?

if tenant_id:
headers["X-Tenant-ID"] = tenant_id
self._base_url = base_url.rstrip("/")
self._api_key = api_key

Choose a reason for hiding this comment

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

Why is this removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

its not used in any of the helper functions, we just use it to set the header

@hari-dhanushkodi
Copy link
Contributor

How come we're not using the offset/next_offset pagination for tailing logs?

as discussed offline, I think this is the best way to implement live tail:

1. first we fetch last limit logs in descending (so we get newest -> oldest in an array)
2. we output the reverse of the output of step 1 (so that old logs appear first, and new logs come to the front)
3. then we do an ascending log fetch with the most recent time stamp we got in step 1, so we don't fetch anything older than this, and we output to the screen and repeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants