Container logs are stdout and stderr from a sandbox’s main process. Stream them withDocumentation Index
Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
Use this file to discover all available pages before exploring further.
stream_logs(), which captures output from the command passed to Sandbox.run(). Output from exec() commands is not included. Use Process.stdout or Process.stderr for that. Returns a StreamReader that yields log lines. Iterate synchronously or asynchronously.
When you call
Sandbox.run() without a command, the sandbox’s default command does not write to stdout or stderr, so stream_logs() returns no output. Pass a command that writes to stdout or stderr.Retrieve recent logs
Follow mode
Stream logs continuously, liketail -f. The iterator blocks until new data arrives.
Filter by time
Only retrieve logs after a specific timestamp.Timestamps
Prefix each line with an ISO 8601 timestamp from the server.Async iteration
Retrieving logs from stopped sandboxes
You can retrieve historical logs from sandboxes that have already completed, failed, or been terminated:follow=False (the default) is supported for stopped sandboxes.
See also
- Command execution - Running commands and streaming their output with
exec() - Sync vs async - Iteration patterns