write log only when validation fails