How to log all files that have been opened?
No a keylogger will only perform a logging of the key you type on your keyboard.

To log all files you open you need a kernel trace function, which will report every open system call. This function is provided by the command
dtrace on MacOS X.

The command opensnoop is a shell script based on dtrace and performing exactly what you are looking for.

I advise you to start by using it in its basic mode:

/usr/bin/sudo opensnoop


And then refine it with the use of grep to eliminate file you are not interested in surveying:

/usr/bin/sudo opensnoop | grep -v /System