Fixed a bug where log_msg were used before the log directory was created