How to view docker-compose healthcheck logs? : <p>Inside my <code>docker-compose.yml</code>, I have the following <code>service</code> <code>healthcheck</code> section. I want to know if MariaDB is actually ready to handle queries. A <code>service</code> named <code>cmd</code> is configured to depend on <code>condition: service_healthy</code>.</p>

<pre><code>  db:
    image: mariadb:10
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: 1
      MYSQL_USER: user
      MYSQL_PASSWORD: password
      MYSQL_DATABASE: database
    healthcheck:
      test: ["CMD", "mysql", "--user=user", "--password=password", "--execute='SELECT 1'", "--host=127.0.0.1", "--port=3306"]
      interval: 1s
      retries: 30
</code></pre>

<p>This healthcheck does not work, shows that the service is unhealthy.</p>

<p>How do I check the output of the <code>test</code> CMD?</p>
