title: How to mount mosquitto docker logs to local pc
body: <p>I have installed <code>eclipse-mosquitto</code> <a href="https://hub.docker.com/_/eclipse-mosquitto" rel="nofollow noreferrer">docker image</a> in Ubuntu. I am trying to run it using <code>docker-compose</code>. Mosquitto needs 3 directories as explained in docker hub page:</p>
  <ol>
  <li>config : which contains mosquitto.conf and bridge.conf files</li>
  <li>data: which contains mosquitto.db file</li>
  <li>log: which contains mosquitto.log file</li>
  </ol>
  <p>In my local PC I have created a directory named <code>mosquitto</code> which has all the above directory and files:</p>
  <pre><code>mosquitto
  
      -&gt; config
          -&gt; mosquitto.conf
          -&gt; conf.d
              -&gt; bridge.conf 
      -&gt; data
          -&gt; mosquitto.db
      -&gt; log
          -&gt; mosquitto.log
  </code></pre>
  <p>Below is the docker-compose.yml file:</p>
  <pre><code>version: '2.4'
  
  services:
      mosquitto:
          image: eclipse-mosquitto:latest
          volumes:
              - /home/john/Documents/docker/mosquitto:/mosquitto
          restart: always
  </code></pre>
  <p>and I am starting it as <code>sudo docker-compose up</code>. Its container starts to run fine and I can see all the directories and files properly mounted inside the mosquitto container. I can see the logs starts to come and <code>mosquitto.log</code> file size is also increasing inside the container but there is no log present in my local pc.</p>
  <p>Why is this happening when I have mounted the volume. I want to also get the logs in the <code>mosquitto.log</code> in ubuntu local pc. How can I do this. Can anyone please suggest some good solution. Thanks</p>