I’ll start:

When I was first learning to use Docker, I didn’t realize that most tutorials that include a database don’t configure the database to persist. Imagine my surprise when I couldn’t figure out why the database kept getting wiped!

You are viewing a single thread.
View all comments View context
1 point

I prefer this method:

{
  "log-driver": "syslog",
  "log-opts": {
    "tag": "docker.{{.Name}}"
  }
}

This way container logs are forwarded to /var/log/syslog, which already contains all other services logs, and has sane rotation rules by default (and it allows rsyslog to manage log forwarding/shipping if needed).

permalink
report
parent
reply
1 point

Thanks, good to know! I had no idea about the tags. Looks like there’s a lot more variables available.

I just reread the docs on the log drivers - they mentioned that as of docker 20.x local logs now work with all drivers as it buffers the logs locally as well. I think this is probably why I hadn’t explored the other drivers before - couldn’t use docker-compose logs.

permalink
report
parent
reply

DevOps

!devops@programming.dev

Create post

DevOps integrates and automates the work of software development (Dev) and IT operations (Ops) as a means for improving and shortening the systems development life cycle.

Rules:

  • Posts must be relevant to DevOps
  • No NSFW content
  • No hate speech, bigotry, etc
  • Try to keep discussions on topic
  • No spam of tools/companies/advertisements
  • It’s OK to post your own stuff part of the time, but the primary use of the community should not be promotional content.

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

Community stats

  • 1

    Monthly active users

  • 57

    Posts

  • 46

    Comments