The LogSPU directive allows you to create log files that only contain information about users' access to a particular starting point URL on your site. These files are useful for many purposes, including collection assessment, troubleshooting issues with specific resources, and understanding which users access which resources most frequently.
LogSPU is a position-independent config.txt directive that is used to log usage information of Starting Point URLs in the spu.log file. The name of the spu logs can be changed using the same filename format as LogFile, and the information logged can be changed by entering logging fields in the same format as LogFormat.
To record the use of each starting point URL to a file named spu.log in common log file format, use:
LogSPU spu.log %h %l %u %t "%r" %s %b
As with the default LogFormat, this directive statement will provide you with the following information in this order:
%h
: the IP address of the Host accessing EZproxy%l
: the remote username obtained by identd, if identd is used; if identd is not used, you will see a -%u
: the username or session identifier, based on other config.txt options; if the necessary related directives are not included in your config.txt file, you will see a -%t
: the date and time the request was made"%r"
: the complete http request sent to the remote server; this field is contained in quotation marks so it is parsed as one piece of data even though it contains spaces, since spaces are generally a signal that a new field of data is beginning%s
: the HTTP numeric status of the request; see Log File Analysis on the EZproxy Log Files page for more details about EZproxy-specific codes%b
: the number of bytes transferredTo command EZproxy to record starting point URL information in a new log file each day, labeled with the date, use the following line:
LogSPU -strftime spu%Y%m%d.log %h %l %u %t "%r" %s %b
This directive statement will record all the information outlined above in the spu logs, but it will begin a new log each day and name each daily log file spuyyyymmdd.log.
To create a tab-delimited file for analysis, use a directive statement with the following format substituting the fields for the details you would like to have recorded:
LogSPU -strftime spu%Y%m%d.txt %{%Y/%m/%d:%H:%M:%S}t\t%h\t%u\t%{ezproxy-spuaccess}i\t%v\t%U
This example creates log entries similar to the example below, with tabs between each of the following fields: the date/time of the request, the remote IP address of the user, the username (if Option LogUser includes in config.txt ; - otherwise), the type of access, the remote hostname accessed, and the complete remote URL requested.
2008/03/14:09:39:20 123.456.789.101 - proxy www.somedb.com http://www.somedb.com/search/
The SPU logs can be used for many purposes. Two possible uses are outlined below.
Collection Evaluation
Entering the LogSPU directive with the default fields used by LogFormat and renaming the file with year, month, and date as used by LogFile directive below will provide you with sufficient information to determine which resources are accessed most frequently, when, and by whom. This information can help you to make collection decisions:
LogSPU –strftime spu%Y%m%d.log %h %l %u %t “%r” %s %b
User Group Evaluation
If you are interested in evaluating which categories of users utilize which resources most frequently, you can add a group or usrvar field (based on which of these options you have used to categorize your users) to your LogSPU directive to collect this information as well. This directive statement would look as follows:
LogSPU –strftime spu%Y%m%d.log %h %l %u %t “%r” %s %b %{ezproxy-groups}i
OR
LogSPU –strftime spu%Y%m%d.log %h %l %u %t “%r” %s %b %{ezproxy-usrvar #}i
The first option will provide you with information about user groups if you have these groups defined in your config.txt and user.txt files. The second option will provide you with user group information if you used the usrvar condition in your user.txt file to define user groups. For more information about how to configure these user categories, see Groups or UsrVar.
Groups, LogFile, LogFilter, LogFormat, Option LogSession, Option LogUser, UsrVar