added parameter to turn on/off logging (readserver(), writeserver())