Changed checkconfigValid to write to the log