yes, it is possible. in the .htaccess file, where you block hotlinking, you can forward the hotlink to any page you wish. simply forward it to a php page, pass any query strings you need to it and log the data
for example in your .htaccess file
all the code to check for bad referer, and then
RewriteRule .*.(gif|jpg|jpeg|bmp)$ http://yoursite.com/loghotlink.php?ref=%{HTTP_REFERER}&file=%{REQUEST_FILENAME} [R,NC]
in loghotlink.php do something like
$fp = fopen("log.txt", "a");
fwrite($fp, $GET['ref'] . " tried to access " . $GET['file'] . " on " . date("dS F Y h:i:s A") . "\r\n");
fclose($fp);