Added log functionality.