add logging to read-key creation function