Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created March 23, 2022 21:30
Show Gist options
  • Save ddrscott/b1737f54e7f4b9dbfb4622ff69179c73 to your computer and use it in GitHub Desktop.
Save ddrscott/b1737f54e7f4b9dbfb4622ff69179c73 to your computer and use it in GitHub Desktop.
watch all the logs from everything in a namespace
kubectl logs -fl 'app!=empty' --all-containers --max-log-requests 999
# specify namespace
kubectl -n my_project logs -fl 'app!=empty' --all-containers --max-log-requests 999
# in case you have a label `app` equal to `empty`
kubectl -n my_project logs -fl 'any_existing_label!=a_real_value' --all-containers --max-log-requests 999
kubectl -n my_project logs -fl 'foo!=bar' --all-containers --max-log-requests 999
@ddrscott
Copy link
Author

For some reason, logs require the user to specify a specific Pod or label. This makes it a pain when there's any number of Pods that may be causing an issue or we want to see the logs in the context of other pod logs.

These commands allow us to see everything from kubectl without setting up other logging infrastructure, yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment