GitHub

Managing deployment

Logs

Outblocks supports printing and streaming logs from the services you deployed. Besides printing the logs, you will get the link to GCP Logs Explorer you can open in a browser.

ok logs

Example output:

INFO  Logs Explorer Web UI: https://console.cloud.google.com/logs/query;query=%28%28resource.type%20%3D%20%22cloud_run_revision%22%20resource.labels.service_name%20%3D%20%28%22app-static-website-dev-5a31%22%29%29%29%20timestamp%20%3E%3D%20%222022-05-02T08:34:37Z%22?project=outblocks`

Streaming logs

ok logs -w

Example output:

INFO  Logs Explorer Web UI: https://console.cloud.google.com/logs/query;query=%28%28resource.type%20%3D%20%22cloud_run_revision%22%20resource.labels.service_name%20%3D%20%28%22app-static-website-dev-5a31%22%29%29%29%20timestamp%20%3E%3D%20%222022-05-02T08:39:30Z%22?project=outblocks


INFO  May  2 10:44:56.052 217.170.130.100 - GET https://outblocks.io/ 200 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
INFO  May  2 10:44:56.251 217.170.130.100 - GET https://outblocks.io/img/logo_hero.svg 200 "https://outblocks.io/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"

Choosing environment

CLI always sets dev as a default environment, but you can override it with a flag:

ok logs -w --env <environment name>

For example:

ok logs -w --env production

Other options

Please use:

ok logs --help

to see all possible options:

USAGE:
  ok logs [flags]


FLAGS:
  -c, --contains strings       filter logs containing specific words
  -d, --end string             end time
  -q, --filter string          pass raw filter to logs, refer to cloud provider docs for possible options
  -w, --follow                 stream logs (end has to be unspecified)
  -x, --not-contains strings   filter logs not containing specific words
  -a, --only-apps              target only apps, skip all dependencies
  -l, --severity string        minimum severity level (options: debug, notice, info, warn, error)
  -s, --start string           start time (default "5m")
  -t, --target strings         target only specified apps or dependencies, can specify multiple or separate values with comma in a form of <app type>.<name> or dep.<dep name>, e.g.: static.website,service.api,dep.database
Previous
Database