[ Table Of Contents | Keyword Index ]

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

NAME

ns_accesslog - Control the nslog access log module

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    CONFIGURATION
    EXAMPLES
    SEE ALSO
    KEYWORDS

SYNOPSIS

ns_accesslog option ?arg?
ns_accesslog file
ns_accesslog roll ?file?
ns_accesslog rollfmt
ns_accesslog flags ?flags?
ns_accesslog maxbuffer ?maxnum?
ns_accesslog maxbackup ?maxbum?
ns_accesslog extendedheaders ?headers?

DESCRIPTION

This command provides a mechanism to control the nslog access log module. The legal options (which may be abbreviated) are:

COMMANDS

ns_accesslog option ?arg?
ns_accesslog file
Returns the name of the access log file for the current (possibly virtual) server. The default is relative to the server's module directory in "nslog/access.log".

ns_accesslog roll ?file?
Rolls the access log, or optionally some other file. See ns_logroll for log rolling behavior. However, instead of the max backup being specified in "ns/parameters" as "logmaxbackup", it is specified in section "ns/server/$servername/module/nslog" as "maxbackup" and defaults to 100.

ns_accesslog rollfmt
Set or return folling format

ns_accesslog flags ?flags?
Set or return current flags such as logcombined/formattedtime/suppressquery/checkforproxy

ns_accesslog maxbuffer ?maxnum?
Set or return max number of lines in the buffer

ns_accesslog maxbackup ?maxbum?
Set or return max number of backup files

ns_accesslog extendedheaders ?headers?
Set or return extended headers to be logged

CONFIGURATION

ns_section ns/server/${servername}/module/nslog
ns_param file access.log
Name to the log file

ns_param formattedtime true
true==common log format

ns_param logcombined false
true==NCSA combined format

ns_param maxbuffer 0
Max # of lines in the buffer

ns_param maxbackup 5
Max # of files to keep when rolling

ns_param rollhour 0
Time to roll log

ns_param rolllog true
true==roll the log

ns_param rollonsignal true
true==roll the log on SIGHUP

ns_param suppressquery false
true==Don't show query string in the log

ns_param checkforproxy false
true==check for X-Forwarded-For header

ns_param extendedheaders {Referer X-Forwarded-For}
List of add. headers

When supressquery is true, the side-effect is that the real URI is returned, so places where trailing slash returns "index.html" logs as "index.html"

EXAMPLES

 
   % ns_accesslog file
   /home/ns/servers/exampleServer/modules/nslog/access.log

 
   % ns_modulepath exampleServer nslog/access.log
   /home/ns/servers/exampleServer/modules/nslog/access.log

 
   # This will roll the access.log
   % ns_accesslog roll

 
   nscp:2> ns_accesslog flags
   logCombined formattedTime

   nscp:3> ns_accesslog flags logCombined formattedTime checkForProxy
   logCombined formattedTime checkForProxy

   nscp:4> ns_accesslog extendedheaders

   nscp:5> ns_accesslog extendedheaders X-Forwarded-For Accepted
   X-Forwarded-For Accepted

SEE ALSO

nsd

KEYWORDS

ns_logroll, , ns_modulepath