0
0
Dockerdevops~10 mins

Centralized logging setup in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the logging driver in a Docker run command.

Docker
docker run --log-driver=[1] nginx
Drag options to blanks, or click blank then click option'
Ajson-file
Bsyslog
Cnone
Dlocal
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'syslog' without configuring a syslog server
Using 'none' disables logging
2fill in blank
medium

Complete the Docker Compose service to use the syslog logging driver.

Docker
services:
  app:
    image: myapp
    logging:
      driver: [1]
Drag options to blanks, or click blank then click option'
Asyslog
Bjournald
Cfluentd
Djson-file
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'json-file' which stores logs locally
Choosing 'fluentd' without a Fluentd server configured
3fill in blank
hard

Fix the error in the Docker daemon.json configuration to enable centralized logging with Fluentd.

Docker
{
  "log-driver": "[1]",
  "log-opts": {
    "fluentd-address": "localhost:24224"
  }
}
Drag options to blanks, or click blank then click option'
Asyslog
Bnone
Cjson-file
Dfluentd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'json-file' which stores logs locally
Using 'none' disables logging
4fill in blank
hard

Fill both blanks to configure Docker Compose to send logs to a remote syslog server with a tag.

Docker
services:
  web:
    image: nginx
    logging:
      driver: [1]
      options:
        syslog-address: [2]
Drag options to blanks, or click blank then click option'
Asyslog
Bfluentd
Ctcp://192.168.1.100:514
Dudp://192.168.1.100:514
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fluentd' driver with syslog address
Using TCP address without matching driver
5fill in blank
hard

Fill all three blanks to create a Docker Compose logging config that sends logs to Fluentd with a custom tag.

Docker
services:
  backend:
    image: mybackend
    logging:
      driver: [1]
      options:
        fluentd-address: [2]
        tag: [3]
Drag options to blanks, or click blank then click option'
Asyslog
Bfluentd
Cbackend.logs
Dlocalhost:24224
Attempts:
3 left
💡 Hint
Common Mistakes
Using syslog driver with fluentd options
Incorrect tag format