Administration Guide : Xinet Logging : Web Access logs

Web Access logs
Xinet provides Web Access logs so that you can monitor how Xinet is being used over the Internet. The Logging, Web Access page presents an easy way to look at what’s happening. You can also parse the accesslog file on the server with other programs or scripts, for example, if you charge on a per-usage basis, to automatically generate invoices. Xinet TechNote 102 available at www.northplains.com/xinet provides more information about this.
Navigating the log on-line is quite straight-forward:
1.
Click on the Logging, Web Access tab. The following page will appear:
2.
Using the Access log for pop-up list, select the user whose usage you want to look up. Note, that you can also choose to view system-wide Xinet activities by selecting All Users.
3.
4.
Full Listing
Bytes transferred
Uploads only
File Manager only
Administration only
5.
Click the View Log button to update the screen. What you see next depends on the log type you’ve requested. Figure 5 shows a full listing:
The Logging, Settings, Web Access tab (Web Access Log rotation and archive schedule) allows you to determining the rotation schedule and length of time archives will be kept for this log.
Interpreting what you see
If you decide to show full listings in the log, the top portion of your report will show a chronological listing of Xinet activity on a file-by-file basis, including information about who initiated the download/upload/preview, the machine address where the activity originated, the name of the file, the file’s type, the size of the file on the server, and the size of the compressed file actually sent. Xinet provides the compressed file information because some Internet users are actually charged for the amount of bandwidth they use and may want to pass that expense on to the user.
If you want more information about a particular file, you may click on the file name in the table and open the file’s information page. Click the Cancel button to return to the log file.
Finally, by scrolling to the bottom of the page, you’ll find a Usage summary where total amounts from the detailed list above are given.
If you’d like to look at the log file directly, you can find it in the following place in the file system:
Unix /var/adm/webnative/accesslog
Windows C:\Program Files\Xinet\WebNative\Admin\accesslog
Some of the information there gets interpreted for its presentation in the xinet ADMINISTRATION view, so what you see in the file itself will look a little different. The format of the accesslog file has been designed to facilitate easy parsing by C programs, Perl programs, and Unix shell scripts. In addition, you can easily import the data from it into Excel.The general idea is that you should be able to easily determine which user has downloaded or uploaded files and be able to charge them based on a variety of criteria: the size of the files, whether they accessed high-resolution or low-resolution files, the number of actions, etc.
New entries are always added to the bottom of the accesslog file. The format of each entry is standardized as follows:
4 1150985553 grover 131.106.110.74 /space/TPT14606222.indd n/a 2 135597 135597
Here is what each field records:
field 1: a numeric value of 1, 2,3 or 4.
If this field is a 1, then the format of the entry is the first format used in Xinet (for example. the oldest format we have used.) If it is 2, the format is the second type used for the file, etc. The current format is represented by a 4 in this field.
Any script/program that parses the fields of this file should look at this first field to tell what format to expect in the entry.
field 2: the second field indicates the time of the activity.
Inside the file itself (but not in the xinet Administration view) time is given in Unix time, meaning seconds since January 1st, 1970. The advantage of this format is that it can be converted to local time using whatever format is appropriate. For instance, the date can be converted to European standards (with the day first and month second) or to non-English spellings of months. It is also simpler to store the date in one field rather than three.
If you were parsing the file using a C program, you might use ctime to convert the seconds into the local time. See the Unix man page for more details about ctime(3M).
One might also do the conversion using Perl. A simple macro, such as the example below, would convert the date for Excel:
Sub ImportAccessLog()
'
' ImportAccessLog Macro
' This Macro imports a file in the WebNative AccessLog format, where
' the second field indicates the time of the download in Unix time, for example.
' "seconds since January 1, 1970." The file is imported, and then the
' time is converted to Mac Excel time, which is "seconds since January 1,
' 1904." For use with Windows Excel or with a Mac where the time system
' of "seconds since January 1, 1900" is in use, change 24107 in the macro
' to 25569.
 
'Pop up dialogue to select file
myfile = Application.GetOpenFilename("TEXT")
Workbooks.OpenText _
FileName:=myfile, _
Origin:=xlMacintosh, _
StartRow:=1, _
DataType:=xlDelimited, _
TextQualifier:= _
xlDoubleQuote, _
Tab:=True, _
FieldInfo:=Array(1, 1)
' Insert a new column for the new dates
Columns("C:C").Insert Shift:=xlToRight
' Find the last cell in use
Selection.SpecialCells(xlCellTypeLastCell).Select
' Range is set to first through last cells to use in the new column
Range("C1", ActiveCell.Offset(0, -6)).Select
' Set the formula. This value is for the 1904 date system. If the 1900
' date system is in use, change 24107 to 25569.
Selection.Formula = "=PRODUCT(RC[-1],1/86400) + 24107"
' Convert formula to values so the original values can be deleted
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
' Delete the original date column
Columns("B:B").Delete Shift:=xlToLeft
' Set the format for the new date column
Columns("B:B").NumberFormat = "m/d/yy h:mm"
End Sub
Note that date is not Unix time and that there is no year listed.
field 3: the Xinet user who did the downloading/uploading/previewing.
field 4: the IP address of the machine that initiated the activity.
field 5: the full path of the file in question.
field 6: the place to which a file has been moved via the Xinet File Manager facility. In most cases, because File Manager hasn’t been used, the field will be marked n/a.
field 7: the exact action by the user. Each number represents the following action:
 
 
Viewing the 72 dpi preview is listed as an action you may want to charge for because these previews are web-ready. In other words, they can be copied by a Xinet user and incorporated as an image onto another Web site.
field 8: the size of the file on the server; for example. the image in its decompressed state.
This field allows you to charge by the bytes taken up on the server.
field 9: the size of the image as it is sent over the Internet; for example. the image after it is compressed.
This field allows you to charge by the bytes taken up on the Internet (bandwidth) by the download/upload.
Note that the compressed size is not always smaller than the uncompressed size. If the file is an FPO, then the compressed version will not be smaller. Sometimes the headers added in the compression process make the compressed file larger than the original.