Improved logging in the history daemon