Fixed logging. The timestamps need conversion before going to ctime().