logs
logs prints the log of one environment straight to your terminal, so you can pipe it into grep, less or a file without opening MyKinsta.
kinstactl logs my-site --env livekinstactl logs my-site access --env live --lines 200 --search wp-loginRead the error, access or cache log of an environment.
kinstactl logs my-site access --env live --lines 200 --search wp-loginkinstactl logs <site> [type] [options]Read the error, access or cache log of an environment
Arguments
| Argument | Description |
|---|---|
site | site name, display name or ID |
type | log type Choices: error, access, cache. |
Options
| Option | Description |
|---|---|
--env <environment> | environment name or ID |
--lines <n> | number of lines (max 20000) |
--search <text> | only lines containing this text |
--from <datetime> | only lines from this date and time |
--to <datetime> | only lines up to this date and time |
Global options --profile, --json and --no-input apply too. See scripting and CI.
Kinsta API: GET /sites/environments/{env_id}/logs
The optional type argument is error, access or cache and defaults to error. --lines defaults to 1000 and accepts 1 to 20000. --search keeps only the lines that contain the text, and --from and --to limit the log to a window in time; Kinsta applies all of these filters, not kinstactl. Without --env the usual environment selection applies, see Sites and environments.
The log is written to stdout as plain text, exactly as Kinsta returns it, with no table, colors or decoration, whether or not a terminal is attached. That makes it safe to pipe:
kinstactl logs my-site access --env live --lines 5000 | grep " 500 "With --json you get the complete API response instead of the bare text.