liveBook · Manning

Logging level

As explained in Learn Docker in a Month of Lunches, Second Edition

A logging level specifies the severity threshold and amount of diagnostic information an application records.

A logging level sets how much diagnostic information an application records. A minimum setting may show only errors, while a more detailed setting emits debug lines useful for investigation. section 15.6 section 6.3

Apply a logging level through the configuration path used by the application:

  • Override the packaged configuration with a host directory mounted into the container, preferably read-only when the application only needs to read it. section 6.3
  • In Kubernetes, inject the logging configuration into the expected container path and check whether existing Pods reload it; recreate the Pods if they do not. section 15.6
  • Balance diagnostic value against storage by producing verbose logs but filtering records before they reach long-term storage. section 19.4

Detailed container logs

Mount a local configuration directory at /app/config with Docker. The application loads its logging configuration and produces debug lines that do not appear with the standard configuration. section 6.3

cd ./ch06/exercises/todo-list
# save the source path as a variable - on Windows:
$source="$(pwd)\config"; $target="c:\app\config"
# OR on Linux
source="$(pwd)/config" && target='/app/config'
# run the container using the mount:
docker container run --name todo-configured -d -p 8013:8080 `
 --mount "type=bind,source=$source,target=$target,readonly" `
 diamol/ch06-todo-list:2e
# check the application:
curl -s http:/./localhost:8013
# and the container logs:
docker container logs todo-configured

Use the platform-specific Docker command to mount the local configuration directory at /app/config as read-only, then inspect the application logs. section 6.3

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains thresholds, configuration injection, Pod replacement, and downstream filtering without detailing logging-level taxonomies.
Examples
Uses a to-do application, logging.json, Docker bind mounts, Kubernetes Pods, and Fluentd routing rules.
What it assumes
Assumes basic Docker or Kubernetes deployment experience and teaches configuration overrides through runnable application examples.
What you can do after
Operate/configure containerized applications with more detailed logs and filter verbose records without changing application containers.
How it connects
Connects logging levels with Docker containers, bind mounts, Kubernetes, Fluentd, and Elasticsearch.

Also explained in

Compare how 9 books explain logging level →

Related concepts

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