Difference between revisions of "Customized Logs"

From Genwiki

Jump to: navigation, search
(Potential security issue eliminated (v1.5))
Line 11: Line 11:
 
* It will enhance the filter options available through the ADMIN->SETUP->Log Settings.  Filtering based upon Host IP Address and logged in User Descriptions will be added to the existing filter on Host Name.
 
* It will enhance the filter options available through the ADMIN->SETUP->Log Settings.  Filtering based upon Host IP Address and logged in User Descriptions will be added to the existing filter on Host Name.
  
For an example of how your log will appear, [http://genealogy.mcfadyen.ca/showlog.php|check here].  (This log has the referrer information turned on and will not look exactly the same as the original.  The default install option will appear the same as the original log)
+
For an example of how your log will appear, [http://genealogy.mcfadyen.ca/showlog.php check here].  (This log has the referrer information turned on and will not look exactly the same as the original.  The default install option will appear the same as the original log)
  
  

Revision as of 20:53, 24 January 2007

If you are not comfortable with html and php editing, this page may not be for you


Overview

This TNG modification will change the way site accesses are logged.

  • It will include additional information indicating where the access was linked from (the referrer info)
  • It will split the log into two files: one for browsers and one for crawlers
  • It will enhance the filter options available through the ADMIN->SETUP->Log Settings. Filtering based upon Host IP Address and logged in User Descriptions will be added to the existing filter on Host Name.

For an example of how your log will appear, check here. (This log has the referrer information turned on and will not look exactly the same as the original. The default install option will appear the same as the original log)


  • Rev 1.5 Jan 24, 2007 - potential logging of login referrer information has been eliminated (potential for encrypted passwords to have been logged if your page accesses came directly from the login screen) (only the log.php file was changed)
  • Rev 1.4 Jan 15, 2007 - minor updated for V6.0.4
  • Rev 1.3 Jan 3, 2007 - Referrer information in the showlog is now an option, defaulted off
  • Rev 1.2 Nov 19, 2006 - Package names updated, NO file changes required for V6.0.3


Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG files
    • showlog.php
    • log.php


Side Effects

  1. As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod.


TNG Installation Contents

The following zip file contains the necessary files to allow the addition of this feature.

  • The zip file Customized Logs Rev 1.5.zip contains:
    • botlogxml.php - this file extracts and prints the crawler log file, called from showbotlog.php, fashioned after logxml.php
    • version 6.0.4
      • log.php a modified TNG file
      • showlog.php a modified TNG file
      • showbotlog.php - this will frame the crawler log file (fashioned after showlog.php)
    • botgenlog.txt - a blank crawler log file


Installation for TNG Version 6

  • IF you are not running TNG version 6.0.4, or you have modified either log.php or showlog.php, DO NOT proceed. You will lose any modifications you have made to those files. Note v6.0.4 will work for all earlier V6 versions
  1. ensure you have a backup of the following files found in your base TNG folder
    • log.php
    • showlog.php
  2. download this zip (Customized Logs Rev 1.5.zip)
  3. unzip it, examine the contents
  4. select the log.php,showlog.php, and showbotlog.php files from the appropriate version folder
  5. The log.php file may need to be customized to identify your favourite crawlers
    • it is preconfigured for googlebot, msnbot, inktomi, werelate, Panscient, gigablast, and [IP 74.6x.x.x] which is inktomi where there were no dns entries.
    • if you wish to add others then
      • locate, open, and edit the new log.php file. You can use notepad, wordpad, or another text editor
      • find the section that checks for the crawlers and add another line following the same syntax
      • save and close the file
  6. copy all 5 files to your base TNG folder
    • the two files identified in step 1 will replace existing TNG V6.0.x files
  7. ensure the new logfile "botgenlog.txt" is writeable
  8. check it out


How do I see what it is doing?

  • Regular browser accesses will continue to be added to the normal log file. This will continue to be viewed as always, through accessing the showlog.php script.
  • Crawler accesses (those listed in the log.php file) will be diverted to the botgenlog.txt file. This may be viewed directly via the showbotlog.php script, or by clicking on the link on the Regular access display page just above the log listing.
  • Remember that you can exclude log entries to the regular Browser log by listing them on the Admin->Setup->Log_Settings page. Use the field labeled "Exclude Host Name". You can insert multiple exclusions separated by commas.
    • exclude by specific IP address: 192.168.1.1
    • exclude by IP address range: 192.168.1.
    • exclude by Host Name
    • exclude by any part match of the User Description: If your admin user description was Site Administrator, then entering Admin would exclude that user's entries when logged in


Optional Referrer Information

If you wish to add the referrer information to your showlog to see where people are browsing from before getting to your page, you can turn on the option in the log.php file. A few lines from the top contains an option to enable this feature. BEWARE: the referrer information is often long and messy. Although I used a few rules to shorten some of the information, it can still be a little ugly compared to the original log.


In the event of a problem with this modification

  1. copy your backup log.php and showlog.php files to your base TNG folder
    • all should be well now
  2. you may also delete the botlogxml.php, showbotlog.php, and botgenlog.txt files


Support

  1. You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
    • Please post suggestions, or your own flavour of this mod to the forum or list
Personal tools