liveBook · Manning

Log relay

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

A log relay is a process that reads application log records from one sink and writes them to stdout.

A log relay reads application records from a file or other sink and writes them to stdout, allowing container logging to capture them without changing the application. section 19.2

Use the pattern when:

  • The application runs in the background and cannot be configured to write directly to stdout. section 19.2
  • The relay starts after the application and watches its log file. section 19.2
  • Health checks connect application and relay failures, because either process can leave the container in a misleading state. section 19.2

Package and start the relay

Copy the application and utility into the image. On Windows, run `start /B dotnet TimeCheck.dll && dotnet Tail.dll /logs timecheck.log`; on Linux, run `dotnet TimeCheck.dll & dotnet Tail.dll /logs timecheck.log`.

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

How deep it goes
Explains startup ordering, platform syntax, failure modes, health checks, and disk costs without detailing relay internals.
Examples
Demonstrates a .NET TimeCheck application, a Tail utility, Linux and Windows CMD commands, and Docker log inspection.
What it assumes
Assumes basic container commands and application log files while teaching the stdout relay pattern from its operational problem.
What you can do after
Operate/configure a container that relays file-based application logs and verify output with Docker commands.
How it connects
Connects Docker logging with stdout, background processes, health checks, and multi-stage Dockerfiles.

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.