changed --file to --logdir. adding checks.