+ moved shutdown to top level
+ added 'ensureDir' to logger init