Drupal web page logging I have a website built on drupal. I want to log (preferably db log) all the calls being made to a drupal page. The drupal page is called as shown here

http://www.example.com/page-name?url=example2.com&amp;redirect=example3.com&amp;uid2=randomNumber

I need to log all URL fields (url,redirect,uid2) alongwith timestamp and drupal user id.

Whats the best way to do it?
Create a custom module, for example:

MODULENAME.install file with hook_schema() implementation:

&lt;?php

/**
 * Implements hook_schema()
 */
function MODULENAME_schema() {
  $schema['MODULENAME'] = array(
    'description' =&gt; 'Description of the table.',
    'fields' =&gt; array(
      'timestamp' =&gt; array(
        'description' =&gt; 'Timestamp of the rquest.',
        'type' =&gt; 'int',
        'unsigned' =&gt; TRUE,
        'not null' =&gt; TRUE,
      ),
      // definitions for the rest of fields here
    ),
    'indexes' =&gt; array(
      // define indexes
    ),
    'primary key' =&gt; array('NAME_OF_PRIMARY_KEY_FIELD'),
  );
  return $schema;
}

?&gt;


MODULENAME.module file with hook_menu() implementation:
    

/**
 * Implements hook_menu()
 */
function MODULENAME_menu() {
  $items['page-name'] = array(
    'title' =&gt; 'Example title',
    'access callback' =&gt; TRUE, // imply no restrictions
    'type' =&gt; MENU_CALLBACK,
    'page callback' =&gt; 'MODULENAME_pagename_view',
  );
  return $items;
}

function MODULENAME_pagename_view() {
  global $user;
  // insert into Drupal database
  db_insert('MODULENAME')
    -&gt;fields(array(
      'timestamp' =&gt; REQUEST_TIME,
      'user_id' =&gt; $user-&gt;uid,
      'url' =&gt; $_GET['url'],
      'redirect' =&gt; $_GET['redirect'],
      'uid2' =&gt; $_GET['uid2'],
    ))
    -&gt;execute();
}

?&gt;