Remote logging tool codlog.pl version 0.1

Kendokan kendokan at amateur-hour.net
Tue Feb 3 23:21:31 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have no idea if a similar tool already exists, but I needed this and it
was fun to write. Some of you might find it useful.

http://amateur-hour.net/download/codlog-0.1.tar.gz

This Perl script codlog.pl tails a file, in particular games_mp.log, and
sends it to a remote server over an IP network via UDP. If you are
familiar with HL/CS's logaddress command, I wrote this to provide the same
functionality. In other words, as events are added to your game server's
log file they are also sent across an IP network to a remote server for
storage.

The same script will operate as either a log sender or a log receiver, set
by a command-line switch. Essentially, just make sure that the required
CPAN modules are installed on your servers and put a copy of codlog.pl on
both servers. You use a command-line switch to set the mode, sender or
receiver. The receiver also creates a new log file for each map, which
should make parsing stats with mohstats faster since you can keep the
cache file.

Usage: codlog.pl [OPTIONS]
  -h, --help           display this help and exit
  -s, --sender         runs as a log file sender
  -r, --receiver       runs as a log file receiver
  -a, --address        address to send to or receive from
  -p, --port           UDP port to send to or receive on
  -f, --file           log file to send (sender mode only)
  -d, --directory      directory to store log files in (receiver mode only)
  -e, --echo           echo sent or received info to console


For example, on the game server:

/path/to/codlog.pl --sender --file /path/to/.callofduty/main/games_mp.log
- --address web.server.ip.address --port 2001 --echo

On the web server:

/path/to/codlog.pl --receiver --directory /path/to/cod/log/files --address
game.server.ip.address --port 2001 --echo

The File::Tail CPAN module is required and can be found at
http://search.cpan.org/~mgrabnar/File-Tail-0.98. The other modules should
come as part of your standard Perl installation.

Important things to note:

Documentation is scarce (read: this email is the entire documentation at
this point). I'll be happy to answer whatever questions I can.

This is a very early version, completed maybe half an hour ago.

Log files are sent via UDP with no error correction, encryption, or any
other network technology invented after about 1980 or so. Network problems
mean you will lose log information in transit. This will not affect the
log file on the game server, of course, just what the web server receives.
But hey, if the network connection on either your game or your web server
was crap, you wouldn't be hosting anything on it, right?

Running this script will have very little impact on your bandwidth. I
don't have an exact figure, but I'd guess maybe 2kb per second, depending
on how busy your server is and how quickly your players are shooting one
another.

I have no idea if this will run under Windows. It probably will.

Bug reports are welcomed.

This script is released under the GPL. Modify it to your hearts content,
but any changes must also be publicly released with the copyright header
intact (add yourself to it).

     -doug/kendokan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAIHNL1ar3Q33PtakRAl0JAJ9dK0FQQgeVVBJd1sqdhBh7BD7OJACg6vWv
Bq6HDeHSFBsCk5Q6xKF2azE=
=vuDd
-----END PGP SIGNATURE-----



More information about the Cod mailing list