Use ctime_r for logging instead of ctime.