liveBook · Manning

Standard output

As explained in Kubernetes in Action, Second Edition

Standard output is the conventional output stream through which a process writes ordinary textual results.

Standard output, or stdout, is the conventional stream for ordinary application output. Containerized applications commonly write logs to stdout and standard error instead of files, allowing the container runtime to capture them consistently. section 5.3.2

Viewing application output

Kubernetes exposes captured container output through kubectl logs kiada. Add -f to stream new lines as requests arrive, --timestamps to display runtime-added timestamps, or --since=2m to show recent entries. section 5.3.2

$ kubectl logs kiada
Kiada - Kubernetes in Action Demo Application
---------------------------------------------
Kiada 0.1 starting...
Local hostname is kiada
Listening on port 8080
Received request for / from ::ffff:10.244.2.1     #1
Received request for / from ::ffff:10.244.2.5     #2
Received request for / from ::ffff:127.0.0.1      #3

Shows startup messages and request logs retrieved from a running pod through kubectl logs. section 5.3.2

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains stream capture, retrieval, live following, timestamps, and time filtering without detailing runtime internals.
Examples
Uses Node.js application startup and request messages retrieved with kubectl logs.
What you can do after
Operate/configure it with kubectl logs to retrieve, stream, timestamp, and time-filter container output.
How it connects
Connects standard output to standard error, container runtimes, application logs, pods, and kubectl.

Also explained in

Compare how 6 books explain standard output →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.