Fix problem on logs folder creation

Errors occurred when the log folder was not created. Verification has been implemented and if the folder does not exist, it is created.