You run docker logs myapp | grep ERROR, get nothing back, and yet the errors scroll past on screen. That is not grep failing. docker logs writes the container’s stderr to its own stderr, and a plain pipe only carries stdout.
docker logs myapp 2>&1 | grep -i error
docker logs --since 1h myapp 2>&1 | less
2>&1 sends stderr into the same stream as stdout, so grep and less get every line. Without it, the stderr lines go straight to your terminal, unfiltered, which looks like grep is printing them while ignoring the filter.
Most apps write their errors and warnings to stderr, so I think this is usually the half you are looking for. In Bash, |& is a shorter way to write the same thing.
The split is also useful the other way round. To see only what the app sent to stderr, throw stdout away:
docker logs myapp 2>&1 >/dev/null
A container started with -t has a terminal, and then Docker cannot tell the two streams apart; everything arrives as stdout. So if the trick seems to do nothing, check whether the container runs with a TTY.
Further reading: docker container logs, bash(1) manual page: redirection