Search code examples
node.jsdockerdocker-composemean-stackpm2

Docker-compose and pm2 - way to filter log messages?


Environment: Docker-compose, pm2, MEAN app

Is there a way to filter on only certain console.log messages in the docker-compose logging console and suppress the rest?


Solution

  • If you are running docker-compose up -d, you can always then use standard CLI tools like grep on piped data from docker-compose logs -f

    So, basically something like this, docker-compose logs -f | grep 'TAG'