Output issue using multiple files

Hi All
I have 3 below files , I want to

-rw-r--r-- 1 tes devusers 498422 Oct 29 2019 a.log
-rw-r--r-- 1 tes devusers 498422 Jul 20 00:52 a.log
-rw-r--r-- 1 tes devusers 7820 Jul 24 00:52 b.log

so I want to extract 6 lines from each files and in less then 6 day’s and contained "exception " keyword.
I have tried below command . but not working . Could you please help .

for FILE in `find . -type f -mtime -6 -name \*.log`; do echo grep -i exception -C 2 $FILE > /home/rabindra/logdi/failedlogs.txt; cat $FILE; done

For starters:

  1. Use the code tag to protect the code when posting to a Forum.
  2. Use single quotes around the value to the name parameter in the find command:
    -name '*.log'
  3. ALWAYS double-quote variable references in Bash, unless otherwise specifically mandatory:
    "$FILE"
  4. Don’t use all-caps as variable names cuz those are environment variables, which could introduce more bugs:
    $FILE$file, or $_f

You don’t have to use for. There is an exec action which is probably more elegant:

find . -type f -mtime -6 -name "*.log" -exec grep -i exception -C 2 {} \; > /home/rabindra/logdi/failedlogs.txt