Enable passing config directory and implement logging to file