There is already a related question at
How do I turn off wordpress comments ability to capture a users ip address?
But is there a solution to do it for users/mods/admins only?
So that normal anonymous visitors will have their IPs stored but registered users not.
Just add a check for the log in status: