1) redefined ChatLogging as a thread which reads messages from a
blocking queue and writes onto the file. 
2) reading from queue and writing to file methods are now different