Implemented logging in and out.