Updated logging to print keys and values