Updated to log debug and error.