in reply to Hooking the winsock
But assuming you still need to write your own logging app, check out winpcap, which Ethereal also uses. There's a Perl interface to it on cpan... here
Peace, -McD