最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

how to persist logs of docker after every restarts? - Stack Overflow

programmeradmin1浏览0评论

I have a docker compose service as this one.

version: "2.1"
services:
  app:
    container_name: 'my-demo'
    image: 'my-demo'
    volumes:
      - ./config.json:/config.json
    restart: always
    logging:
      options:
        max-size: "1024m"

Every time the service crashed, it tried to restart the service as expected. Whenever I saw a restart, I tried to get the old logs to see what happened (crash logs...etc) to fix the root cause. However, the old, crash log was restarted/overridden as well. Is there anyway to persist the logs after restaring? For example: new log name/tag for every restart?

发布评论

评论列表(0)

  1. 暂无评论