Updated logging functionality