sì, con le socket non è difficile.
ad esempio questa funzione serve per inviare un trackback, ma fare un loging è la stessa cosa:
Codice PHP:
function send_ping($tb_url, $pb_url, $pb_title='', $pb_excerpt='', $pb_blog_name='', $charset='utf-8'){
$url = parse_url($tb_url);
$host = $url['host'];
$pb_id = $url['path'] ."?" .$url['query'];
$post_data = "url=".urlencode($pb_url)
."&title=".urlencode($pb_title)
."&excerpt=".urlencode($pb_excerpt)
."&blog_name=".urlencode($pb_blog_name);
$sk = fsockopen($host, 80, $errno, $errstr, 30);
if(!$sk) echo "Errore $errno: $errstr";
else{
$headers = "POST $pb_id HTTP/1.0\r\n";
$headers .= "Host: $host\r\n";
$headers .= "User-Agent: LIT TrackBack lib\r\n";
$headers .= "Content-Type: application/x-www-form-urlencoded; charset=$charset\r\n";
$headers .= "Content-Length: ".strlen($post_data)."\r\n\r\n";
fputs($sk, $headers.$post_data);
while (!feof($sk)):
$resp .= fgets($sk);
endwhile;
fclose($sk);
return $resp;
}
}