Using Drupal's watchdog()
$ip = '192.168.1.1';
$msg = 'Requesting IP is %ip.';
$vars = array( '%ip' => $ip );
watchdog('citystate', $msg, $vars, WATCHDOG_INFO);$msg is what is printed to watchdog.
$vars is an array of stuff to be put into $msg.
Here 'citystate' is the module's name.