Add --logdir option

Here's the patch to add the new option.