MidnightDocs

Logs and status#

Find out what a deployment did and what a service is doing now.

Before you start#

A linked project directory and an active session.

Deploy logs#

midnight logs -f

Streams the latest deployment's logs for the linked service. This is the fastest way to watch a deploy you just started.

Service logs and metrics#

For an explicit service, independent of the link:

midnight observability logs --project-id prj_... --service-id svc_... --follow
midnight observability metrics --project-id prj_... --service-id svc_...

Use these when you are looking at a service other than the one your directory is linked to.

Status#

midnight status

Shows the current link — the project, environment and service this directory resolves to.

midnight whoami

Shows the server-verified identity and session. Use it when a command is refused and you are not sure which identity you are using.

Deployment state#

Deployment records carry a state, and state transitions are guarded at the database level so an impossible state cannot be recorded. Read the record rather than inferring progress from log volume.

When a deploy or build fails, the diagnosis worker may attach an automated diagnosis to the operation and emit a timeline event that the dashboard renders. See The embedded agent.

Streams#

The server exposes operation event and log streams over server-sent events, so the dashboard and CLI follow the same underlying feed. A CLI --follow and a dashboard view show the same events.

Verify#

  • midnight status names the expected service.
  • midnight logs -f produces output during a deploy.
  • midnight observability metrics returns values for a running service.

If it does not work#

Symptom Check Recovery
logs shows nothing Whether a deployment exists for the linked service Deploy first, or use the explicit observability command
Logs stop mid-deploy Whether the stream dropped or the deploy ended Re-run with --follow; check the deployment record for its final state
status reports no link Whether .midnight/project.json exists Run midnight link in the project directory
A command is refused midnight whoami You may be using a different identity than you expect
Metrics are empty Whether the service is running Metrics need a running workload