Logs Tail
Stream logs in real-time.
Purpose
Watch live logs for immediate feedback during an incident or deployment.
Behavior
- •Execute
gcloud alpha logging tail [FILTER] --project=[PROJECT] --buffer-window=[BUFFER_WINDOW] --format=json. - •If
projectis not provided, use the active project fromgcp-context. - •The
--format=jsonflag is recommended for programmatic consumption. - •Stop streaming after the specified duration or when interrupted.
Inputs
- •
project(optional): The Google Cloud project ID to tail logs from. - •
filter(optional): A valid Cloud Logging filter string. - •
buffer_window(optional): The duration of the buffer window for reordering logs (e.g.,5s). - •
duration(optional): How long to stream logs for in seconds. Defaults to 30s.
Output
Streams log entries (JSON formatted if requested) to the terminal.