For reference, you would have been closer to your goal using echo instead of cat
echo $line | grep "hello"
but your code still wouldn't have worked because you code doesn't assign any value to $line and you would have been writing a lot more code than you need.
I don't think catkin's example does what you want either. catkin's example will give you the total number of lines on which 'hello' appears but when I read what you've written I think that you want the number of files in which hello appears. The two things are only the same if no file contains more than one line that contains 'hello'. What you've written does leave some room for interpretation.
Assuming I'm correct (which I might not be), then I think you want is
$ grep -l hello logs/*inout.log | wc -l
Look at grep's man page to see what the -l option does. You can also try running both
$ grep hello logs/*inout.log
$ grep -l hello logs/*inout.log
and compare the output.