createLog function