log_write function

Formatting and writing of the log.rx object to a log file