Added a create directory check to logging.py