add logging filehandles to fork_cmd and system_call