Capture logs and pid