log randomly selected keys to a file