Add logging functionality.