logx is an enhanced Kubernetes pod log viewer. It fetches pod logs, parses common structured and plain-text formats, highlights useful fields, and works as both a standalone CLI and a kubectl plugin.
- Smart log parsing for JSON and plain-text logs
- Timestamp and log-level detection
- Colorized, readable output
- Multi-container pod support with interactive selection
- Previous container logs with
-p - Live log following with
-f - Container listing with JSON, YAML, and POSIX output
brew tap dantech2000/tap
brew install --cask logxThe cask installs both logx and kubectl-logx. Because kubectl-logx is placed on your PATH, kubectl automatically discovers it as a plugin:
kubectl logx --help
kubectl plugin listDownload the archive for your platform from the GitHub releases page, then place the binaries on your PATH:
logxfor standalone usekubectl-logxforkubectl logx
Kubernetes discovers the plugin form from the kubectl-logx executable name. No plugin registration is required.
Fetch logs from a pod:
logx my-pod -n my-namespace
kubectl logx my-pod -n my-namespaceThe explicit subcommand form is also supported:
logx logs my-pod -n my-namespaceOptions:
-n, --namespace: Kubernetes namespace, defaults to the current context namespace--context: Kubernetes context, defaults to the current kubeconfig context--kubeconfig: Path to a kubeconfig file, defaults toKUBECONFIGor~/.kube/config-c, --container: Container name for multi-container pods-f, --follow: Follow log output-l, --level: Filter logs by level:DEBUG,INFO,WARN,ERROR-p, --previous: Fetch logs from the previous terminated container instance--timeline: Show pod logs and Kubernetes events together sorted by time
Example:
logx my-pod -n my-namespace -c my-container -f -l INFO-l, --level keeps logs at the selected level and above. For example, -l WARN shows WARN and ERROR entries while hiding DEBUG and INFO.
Plain text logs:
kubectl logx my-pod -n my-namespace -l WARNMatches lines such as:
2026-05-15T00:38:03Z WARN upstream latency high
2026-05-15T00:38:04Z ERROR upstream unavailable
JSON logs:
kubectl logx api-pod -n my-namespace -l ERRORMatches fields such as:
{"level":"error","ts":"2026-05-15T00:38:04Z","msg":"request failed","error":"timeout"}Logfmt logs:
kubectl logx worker-pod -n my-namespace -l WARNMatches fields such as:
time=2026-05-15T00:38:03Z level=warn component=worker msg="retry scheduled"
time=2026-05-15T00:38:04Z level=error component=worker msg="job failed"
Bracketed logs:
kubectl logx traefik-pod -n my-namespace -l WARNMatches lines such as:
[2026-05-15 00:38:04] [WARN] [unknown] Traefik can reject some encoded characters in the request path
[2026-05-15 00:38:05] [ERROR] [unknown] Provider failed to sync providerName=kubernetes
Use --timeline to view pod logs and Kubernetes events together in timestamp order:
kubectl logx my-pod -n my-namespace -c my-container --timeline -l WARNExample output:
[2026-05-15 00:38:01] [EVENT] [Normal] Scheduled: Successfully assigned default/my-pod
[2026-05-15 00:38:03] [EVENT] [Warning] Unhealthy: Readiness probe failed
[2026-05-15 00:38:04] [LOG] [ERROR] request failed
[2026-05-15 00:38:05] [EVENT] [Warning] BackOff: Back-off restarting failed container
--timeline is intended for point-in-time troubleshooting and cannot be combined with --follow.
List containers in a pod:
logx containers my-pod -n my-namespaceOutput formats:
logx containers my-pod -o json
logx containers my-pod -o yaml
logx containers my-pod -o posixVersion information:
logx version
logx version --short
logx version --output json
logx version --output yamlShell completion:
logx completion zsh > "${fpath[1]}/_logx"Prerequisites:
Use either asdf or Nix for a consistent toolchain.
With asdf:
asdf installWith Nix flakes:
nix developManual prerequisites:
- Go 1.26 or later
- Access to a Kubernetes cluster for manual testing
kubectlconfigured with the appropriate contextjustcommand runner
Build from source:
git clone https://github.com/dantech2000/logx.git
cd logx
just buildCommon tasks:
just --list
just build
just test
just fmtjust build creates:
bin/logxbin/kubectl-logx
Create and push a version tag:
git tag -a vX.Y.Z -m "Release vX.Y.Z"
git push origin vX.Y.ZThe release pipeline publishes both the standalone logx binary and the kubectl-logx plugin binary. It also updates the Homebrew cask in dantech2000/homebrew-tap.
This project is licensed under the MIT License. See LICENSE.