Solved: Binary file (standard input) matches grep error

Problem

Solved: Binary file (standard input) matches grep error

Problem

I try to get all the text with trace id from the log file, but it report the following error:$ grep traceId ~/logs/api.log
Binary file (standard input) matches

Solution

To solve the problem we can add a -a parameter to grep command like below:$ grep -a traceId ~/logs/api.log

The -a option means on the man document for grep:-a, --text
   Process a binary file as if it were text; this is equivalent to the --binary-files=text option.