Under unix, LISTSERV does not automatically start a new console log file every day.  This was originally intended to make it possible for unix sites to redirect standard output from LISTSERV through any specialized scripts that they might decide to write, with the default being simply to redirect standard output to a file called listserv.log in the $LSVROOT directory.

In the event, few sites ever bothered to write custom scripts for log processing, and instead wrote scripts to stop LISTSERV, rename the log file, and restart LISTSERV on a daily basis via cron.  This can be quite unsatisfactory, particularly for sites with hundreds or thousands of lists and a great deal of traffic.

To help solve this problem, modern versions of LISTSERV for Unix are shipped with a file called "lsv-logger.pl", which can be configured very easily to both rotate your logs automatically and place them in a "standard" location such as /var/log/listserv .  The lsv-logger.pl file should already be present in your LSVROOT directory (if not, it can be downloaded here), and log rotation is enabled by editing the go.user file and uncommenting (and, optionally, editing) the following value:


Before uncommenting the LOG_PATH variable, ensure that the directory where you want the logs to be written has been created (LISTSERV will not create it for you) and that the "listserv" user is able to write there.  In general this requires that the directory thus created have the following minimum permissions and ownership:

drwxr-xr-x.  2 listserv root     4096 Apr 18 09:31 listserv

If "listserv" is unable to write in the directory, you will get console errors like this on startup:

print() on closed filehandle LOGFILE at ./lsv-logger.pl line 41, <STDIN> line 26.

When correctly set up, this results in daily logfiles named listserv-yyyymmdd.log being written into the specified directory.  The logs will autorotate at midnight without any need to stop and restart LISTSERV.  

A few final caveats:

1.Perl 5.6.1 or later is recommended.

2.Be aware that logging occurs ONLY when LISTSERV is running in the background.  The logging process under unix is simply redirection of STDOUT to a file.  When running in the foreground, it is not possible to divert output in this way.  Running in the foreground is a debugging mode only, in any case, and LISTSERV running in production should always be run as a background process.

3.Logs written using lsvlogger.pl will never be deleted by LISTSERV.  You may choose to write a separate script called by cron, or use a standard unix utility such as logrotate(8), to handle this housekeeping issue.  On a busy server, LISTSERV will write quite of bit of data to its log, so it is important to monitor the amount of disk space being taken up by the logs, and to delete old logs on a regular basis.

If the LOG_PATH variable is uncommented but left null, lsv-logger.pl will be bypassed and a single file named listserv.log will be written in the LSVROOT directory.