[ Table Of Contents | Keyword Index ]

ns_logroll(n) 4.99 "NaviServer Built-in Commands"

NAME

ns_logroll - Roll the server log

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    EXAMPLES
    SEE ALSO
    KEYWORDS

SYNOPSIS

ns_logroll

DESCRIPTION

This command rolls the server log. The server log is the file returned from ns_info log and is configured through the "serverlog" parameter in the "ns/parameters" section. The default is the file "log/server.log" in the NaviServer home directory.

The number of backup log files to keep is controlled by the server configuration parameter "logmaxbackup" (I believe this is incorrect -- I believe it is maxbackup not logmaxbackup -jfr) in the "ns/parameters" section. "logmaxbackup" must be greater than or equal to zero and less than 1000. (Note: The source emits an error message that disagrees with the code in nsd/rollfile.c on lines 82--84.)

Backup files are created by testing for the existance of the filename and the backup number (i.e., ".012") appended. If the file representing the max backup count exists, it's deleted. Then, all files are renamed to their next higher filename. Then, the log file is renamed to "filename.000". A new log file is then created and opened to be used as the new log file.

This command's effect can also be triggered by sending the server a SIGHUP signal as well.

COMMANDS

ns_logroll

EXAMPLES

 
   % ns_logroll

 
   # server.log is now rolled

SEE ALSO

nsd

KEYWORDS

ns_info log , ns_log , ns_logctl