9.4.1.4 Up Log Attachment
A focused guide to Up Log Attachment, connecting core concepts with practical Docker and container operations.
Up log attachment refers to docker compose up's default foreground behavior, where the logs of every started service are streamed directly to the terminal, interleaved together, until the command is interrupted or every service exits.
The Default Foreground Behavior
Running up without the detached flag attaches directly to every service's log output, displaying it live in the terminal.
docker compose up
api_1 | Server listening on port 8080
db_1 | database system is ready to accept connections
Each line is prefixed with the originating service's name, making it possible to distinguish which service produced which log line even as output from multiple services interleaves.
Why This Mode Is Useful During Active Development
Seeing every service's log output live, without needing a separate command to view it, is convenient when actively developing and wanting immediate visibility into what's happening across the application as a whole.
docker compose up
A developer can leave this running in a terminal, watching for errors or relevant log output as they interact with the application from elsewhere.
Why This Mode Ties Up the Terminal
Because logs are streamed directly and continuously, this foreground mode occupies the terminal session for as long as the command runs, requiring a separate terminal (or detached mode) for any other work to continue alongside it.
Ctrl+C
Interrupting this command stops the attached services, an important behavioral distinction from simply closing the terminal without first stopping the application properly.
Why Up Log Attachment Matters
Understanding this default, log-streaming behavior — and when to prefer it over detached mode — helps in choosing the most convenient way to start a Compose application for a given situation, whether actively watching its output or simply needing it running in the background.