Added logging mechanism into the State logic.