Updated the writeLogg method