Adding logging functionality.