easyMultiple SelectObjective-mapped
XK0-006 Practice Question: A container produces a large amount of log output…
A container produces a large amount of log output to stdout. Which TWO methods effectively manage log size in a production environment?
⚠ Common exam trap
It's easy for candidates to confuse `docker logs --tail` (a display filter) with actual log size management, or assume that redirecting logs to `/dev/null` is a valid production strategy, when in fact it destroys forensic data and violates operational best practices.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure journald limits for container logging
Journald can be configured to limit the size of log data it stores, including container logs that are sent to the journal. In a production environment, setting `SystemMaxUse=` or `MaxRetentionSec=` in `/etc/systemd/journald.conf` prevents unbounded log growth. Option E is correct because Docker's `--log-opt max-size=10m` truncates the container's log file when it reaches 10 MB, rotating it automatically, which directly manages log size at the container runtime level.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use docker logs --tail 100 to limit output
Why it's wrong here
Only limits the display, not the stored log size.
- ✓
Configure journald limits for container logging
Why this is correct
Journald can be configured to cap log storage for containers.
- ✗
Use a bind mount to redirect logs to /dev/null
Why it's wrong here
Discards logs, which is not a management strategy and loses data.
- ✗
Configure the application inside the container to log to a file
Why it's wrong here
Changes logging destination but does not limit size.
- ✓
Set the --log-opt max-size=10m when running the container
Why this is correct
Limits the log file size per container using the log driver.
Go deeper
Related to this question
Learn chapter
File Permissions and Ownership
Key term
systemd
systemd is a system and service manager for Linux operating systems that initializes and manages processes, services, and system resources after the kernel boots.
Key term
Output
In IT service management, output is the result or deliverable produced by a process, system, or component, such as data, reports, or services delivered to a customer.
About these practice questions
This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.