Fixed a bug in migrate code and seperated logging options into logging.cfg