added option to keep logs and log into single file