Updated log.js to create logging directory if it does not already exist