'Docker logs lost after system reboot when using local file logging driver

I am using docker-compose to start my service and switched to local driver by adding

    logging:
      driver: local

in all the services. It seems that after a system reboot, the logs are not available anymore if using docker logs <container> command. Is this an expected behavior, if yes, is there a way to persist them across system reboot?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source