Create log_dir path directories recursively

This change will create the custom log folder and its parents, if needed, in the case of using absolute paths too.
Merge pull request #2168 from dessant/patch-1

Create log_dir path directories recursively