I think it's probably overkill putting a full-text search engine over a requirement to find matches for "error" in some log files.
You're a bit light on detail & intent & context to be able to answer sensibly, I think.
But you should just start solving the problem. Do whatever is within your capabilities to implement now. And worry about improving it after you deliver a MVP.
I'd just loop over the list of dirs, get a file listing of the *.log files, and read the files looking for "error".
You don't tell us how many directories, where they are located, how many files, how big they are etc. Which is all baseline information for making an informed decision as to how to approach this.