Is there any way to preserve recent keyboard activity in case something accidentally gets deleted?
If you'd still like a key logger here are some choices. There are many keyloggers that do much more than logging the keystrokes. Most have many more features but these can be turned off if you're only interested in keylogging. Some highly rated yet easy to use keyloggers are Aobo Mac Keylogger,  Perfect Keylogger for Mac, and  Refog Keylogger for Mac. Be careful with these because they will log your passwords unless properly set up. Aobo Key Logger is a Mac-only app. These were obtained from this site that rates 5 keyloggers.