I'm searching for something like:
tcpdump -p PID # But tcpdump does not know the PID
lsof -i --continuous # But lsof just runs and exits, no «live logging»
to log which connections an application opens.
In my case, I want to find out to which port git connects when committing. This happens in a fraction of a second, so I cannot use lsof. If there is a lot of traffic, filtering by PID or process name would be useful.