Log in functionality logic for writing to the LOG FILE