Bird
0
0

Given the command:

medium📝 Command Output Q13 of 15
Docker - Logging and Monitoring
Given the command:
docker run --log-driver=fluentd --log-opt fluentd-address=localhost:24224 myapp

What will happen to the container logs?
ALogs will be sent to a Fluentd server running on localhost port 24224
BLogs will be stored only inside the container
CLogs will be sent to Docker's default json-file driver
DContainer will fail to start due to invalid log options
Step-by-Step Solution
Solution:
  1. Step 1: Analyze log driver and options

    The command sets log driver to fluentd and specifies fluentd-address as localhost:24224.
  2. Step 2: Understand effect on logs

    Logs will be forwarded to the Fluentd server at the given address instead of default storage.
  3. Final Answer:

    Logs will be sent to a Fluentd server running on localhost port 24224 -> Option A
  4. Quick Check:

    Fluentd driver + address = logs sent to Fluentd [OK]
Quick Trick: Fluentd log driver sends logs to specified Fluentd address [OK]
Common Mistakes:
  • Assuming logs stay inside container
  • Thinking default json-file driver is used
  • Believing the command causes failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes