getting the line number by extracting a line

grep "KeyNotFoundException" weblogic.log

After running this command the output is

abcxyzexceptions.KeyNotFoundException: Person not found

How to know ..what is the line number of the above string in the log file.

awk '/KeyNotFoundException/ { print NR }' filename

use

grep -n