loginlog function completed, need more test