Added logger with mt support and bg thread for i/o