Bird
0
0

You want to forward Docker container logs to both Fluentd and a local file simultaneously. Which solution best achieves this?

hard📝 Workflow Q9 of 15
Docker - Logging and Monitoring
You want to forward Docker container logs to both Fluentd and a local file simultaneously. Which solution best achieves this?
AConfigure Fluentd to write logs to a local file
BSet the log driver to 'json-file' only
CRun two containers with the same image, one logging to Fluentd and one to file
DUse a logging driver that supports multiple outputs or run a sidecar container to duplicate logs
Step-by-Step Solution
Solution:
  1. Step 1: Understand Docker logging driver limitations

    Docker logging drivers typically support one output destination per container.
  2. Step 2: Identify multi-output solutions

    Using a logging driver that supports multiple outputs or a sidecar container to duplicate logs can achieve forwarding to multiple destinations.
  3. Final Answer:

    Use a logging driver that supports multiple outputs or run a sidecar container to duplicate logs -> Option D
  4. Quick Check:

    Multi-output needs special drivers or sidecar duplication [OK]
Quick Trick: Use sidecar or multi-output driver to send logs to multiple places [OK]
Common Mistakes:
  • Assuming one log driver can send to multiple outputs by default
  • Only setting json-file driver
  • Running duplicate containers instead of duplicating logs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes