I had to, so I removed a service with docker service rm but I forgot to get the log files of the service. Now I am not able to find those. Can anyone help me or suggest to me if and how can I get those log files. I was using json-files driver for logging via yml.

  • It's hard to do that, however, it's not completely impossible. You need to figure out where those files have stored (of course you should discover that on /var/lib/docker/), then using some recovery tools like undelete to restore them.
    – M. Rostami
    Jan 2, 2021 at 11:07

1 Answer 1


There's no special feature to undelete files on the host provided by docker. So if you delete your files using docker, you are left with the same option as when you delete on Linux without using docker:

  1. Learn from your mistake and don't do it again (I'd recommend forwarding logs to an external log aggregator).
  2. Restore from backup.
  3. Do a forensic recovery of the hard drive contents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.