add -d option to give the directory to store the log and snapshot