I'm looking for a way to consolidate the logs from all the containers I start into a single console, clearly divided by containers. I came across a setup that seemed really useful but I'm not sure what software or scripts I need to use to make this happen. Any guidance would be appreciated!
5 Answers
If you prefer sticking with kubectl, you can use this command to tail logs from multiple containers: `kubectl logs -f -l app=yourapp --all-containers=true`. But, check out Kubetail too; it’s designed for combining logs easily! Here’s the link: https://www.kubetail.com/
For multi-console viewing, tools like multitail (https://www.vanheusden.com/multitail/) or Dozzle (https://dozzle.dev/) can help visualize logs from several containers simultaneously.
Have you tried using Stern? It’s a pretty straightforward tool for tailing logs from multiple pods in Kubernetes and would work perfectly for what you need.
You might want to consider using a daemonset log shipper like Fluent. It collects logs from your containers and sends them to a monitoring solution like Elasticsearch or Loki. This way, you can access all your logs centrally rather than in the console.
You can totally use tmux for this! It allows you to set up a custom multi-panel console where you can tail logs from different containers side by side. Here’s a helpful guide on how to get started with tmux: https://opensource.com/article/20/1/tmux-console
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures