Improve logging and ensure the key is loaded persistently.