GrepConsole
GrepConsole copied to clipboard
Support grepping output from commands as well as files
Is your feature request related to a problem? Please describe.
I'm using docker compose
to run multiple containers. The container I need to grep — a Rails server — doesn't log to a file (where docker compose logs
can't see it) but to STDOUT. This is the correct way to work with Docker, but it doesn't work with GrepConsole, which wants a path to a file.
Describe the solution you'd like
I'd like GrepConsole to support piping input from user-supplied commands, so I can grep the output of docker compose logs -f rails
.
Describe alternatives you've considered
The only solution I can find for this particular case is to configure Rails to log to its normal log/development.log
rather than to STDOUT. This then means that nothing that works with Docker logs will be able to interact with the Rails log.
It also doesn't solve the problem for non-Rails containers that don't expose their log files to the host — I wouldn't be able to grep the Postgres logs without finding where they're stored in the Postgres container and adding a mount point to the docker-compose config (which I would then have to keep as a local change and never commit to the repo — all these hacks add up fast and make development a chore…)
Additional context n/a