Fix create_scan_log_function