Used int mode in "mkdir" function to generate the log folder