Implemented logging in/out.