Customized Logs

From Genwiki

Jump to: navigation, search

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


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.11 Apr 27, 2009 - validated and updated for V7.1.0
  • Rev 1.10 Jan 16, 2009 - validated for V7.0.3
  • Rev 1.9a Nov 20, 2008 - correction to botlogxml.php (a missing ;) and validated on V7.0.2
  • Rev 1.9 Jul 1, 2008 - updated files for V7.0.0
  • Rev 1.8 Feb 9, 2008 - updated files for V6.2.0 (only the log.php changed from rev 1.7)
  • Rev 1.7 May 15, 2007 - updated IP address retrieval and display in the log: Thanks go out to [Kees Lourens] for this update (only the log.php changed from rev 1.6)
  • Rev 1.6 May 13, 2007 - updated for TNG V6.1, Thanks go out to [Ken Roy] for this update
  • 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


  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 contains:
    • version 6.0-6.0.4
    • version 6.1 (6.1.0-6.1.1)
    • version 6.2.0
    • version 7.x.x (validated up to V7.1.0)
      • 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)
      • botlogxml.php - this file extracts and prints the crawler log file, called from showbotlog.php, fashioned after logxml.php
      • botgenlog.txt - a blank crawler log file

Installation for TNG Version 6-7

  • IF you are not running TNG version 6.0.1-6.1.1,6.2.0,7.x.x or you have modified either log.php or showlog.php, DO NOT proceed. You will lose any modifications you have made to those files.
  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
  3. unzip it, examine the contents
  4. select the 5 files - log.php,showlog.php,showbotlog.php,botlogxml.php, and botgenlog.txt 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
    • two of the files identified in step 1 will replace existing TNG 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:
    • 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


  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