chat logging function with timestampw, added logfile