Updated the loging functionality