Update script to create log directory at runtime.