# This W3 script records all inbound HTTP requests.  A description
# of each request is stored in -SCRIPT-log.txt where SCRIPT is the base
# name of this script.
#
package require w3
proc w3-default {} {
  w3-allow-xorigin-params
  set msg "------------ New request ---------\n"
  foreach var [lsort [w3-param-list]] {
    append msg "$var [list [w3-param $var]]\n"
  }
  set dnam [w3-param SCRIPT_FILENAME]
  set logfile [file dir $dnam]
  append logfile /-
  append logfile [file root [file tail $dnam]]-log.txt
  set out [open $logfile a]
  puts $out $msg
  close $out
  w3-trim {<p>Ok</p>}
}
w3-start $argv
