Added logdir as an option