How to log ip of client in the trackerstore or sql tracker

Hello everybody! It would be very nice if some body have an idea of How to log ip of client in the trackerstore or sql tracker… please guide with some example