@prop Aloha_log."log_file" "Aloha.log" c @prop Aloha_log."log_dir" "Aloha_logs" c @prop Aloha_log."static" 0 c @prop Aloha_log."dynamic" 0 c @prop Aloha_log."dwm" {} rc ;;Aloha_log.("dwm") = {"day", "month", "week"} @prop Aloha_log."weekinit" 1041415200 rc @prop Aloha_log."incoming_get_packets" 0 rc @prop Aloha_log."incoming_post_packets" 0 rc @prop Aloha_log."help_msg" {} rc ;;Aloha_log.("help_msg") = {"Part of Aloha Web Server", "Handles all logs for all traffic.", "GET, POST, and Errors."} @prop Aloha_log."error_log" {} rc ;;Aloha_log.("error_log") = {} @prop Aloha_log."version" "1073900338" rc ;;Aloha_log.("aliases") = {"Aloha Log"} @verb Aloha_log:"gateway_log" this none this @program Aloha_log:gateway_log "-- called by $kahuna:export_log() --"; "-- figures out what kind of logging is enabled --"; if (caller != $kahuna) return E_PERM; else input = args[1]; "-- Handles direct feedback --"; if ($kahuna.directlogging) this:directlogging(input); endif "-- Handles logging into the MOO server log --"; if ($kahuna.standardlogging) this:standardlogging(input); endif "-- Handles logging into the shell on any file and dir --"; if ($kahuna.fuplogging) this:fuplogging(input); endif endif . @verb Aloha_log:"directlogging" this none this @program Aloha_log:directlogging "-- called by Aloha_Log:gateway_log() --"; "-- Handles direct feedback --"; "-- Mainly for troubleshooting purposes --"; "-- Uses $kahuna.operator as a target --"; Aloha_log = $hash_utils:fetch($kahuna.modules, "Aloha_log"); if (caller != Aloha_log) return E_PERM; else input = args[1]; for x in [1..length(input)] (ticks_left() < $kahuna.ticks_threshold) && suspend(0); toobj($kahuna.operator):notify(input[x]); endfor return; endif . @verb Aloha_log:"standardlogging" this none this @program Aloha_log:standardlogging "-- called by Aloha_Log:gateway_log() --"; "-- Handles logging into the MOO server log --"; "-- that has been defined upon starting the server --"; Aloha_log = $hash_utils:fetch($kahuna.modules, "Aloha_log"); if (caller != Aloha_log) return E_PERM; else input = args[1]; for x in [1..length(input)] (ticks_left() < $kahuna.ticks_threshold) && suspend(0); server_log("ALOHA: " + input[x]); endfor return; endif . @verb Aloha_log:"fuplogging" this none this @program Aloha_log:fuplogging "-- called by Aloha_Log:gateway_log() --"; "-- Handles logging into the shell on any file and dir --"; "-- that has been defined through @configure --"; Aloha_log = $hash_utils:fetch($kahuna.modules, "Aloha_log"); if (caller != Aloha_log) return E_PERM; else choices = {{"file_names", ""}, {"file_namedd", ""}, {"file_namedw", ""}, {"file_namedm", ""}}; input = args[1]; "-- let's check if FUP is installed. --"; if ("FUP" in $list_utils:slice($kahuna.modules, 1)) "-- make sure that the space exists --"; if (this.log_dir in call_function("filelist", "")[2]) "-- handle either static and dynamic logging --"; if (this.static) choices[1][2] = this.log_file; endif if (this.dynamic) for x in [1..length(this.dwm)] "-- handles the day2day case --"; if (this.dwm[x] == "day") choices[2][2] = "Aloha_" + $string_utils:explode($time_utils:mmddyy(ctime()), "/")[1] + $string_utils:explode($time_utils:mmddyy(ctime()), "/")[2] + "20" + $string_utils:explode($time_utils:mmddyy(ctime()), "/")[3] + ".log"; endif "-- handles the week2week case --"; if (this.dwm[x] == "week") "-- taking Wed Jan 1 00:00:00 2003 HST as reference --"; start = this.weekinit; choices[3][2] = "Aloha_" + $string_utils:explode($time_utils:ddmmyy(time() - (time() - 1041415200 - (time() - 1041415200) / 604800 * 604800)), "/")[2] + $string_utils:explode($time_utils:ddmmyy(time() - (time() - 1041415200 - (time() - 1041415200) / 604800 * 604800)), "/")[1] + "_" + $string_utils:explode($time_utils:ddmmyy(time() - (time() - 1041415200 - (time() - 1041415200) / 604800 * 604800) + 604800), "/")[2] + $string_utils:explode($time_utils:ddmmyy(time() - (time() - 1041415200 - (time() - 1041415200) / 604800 * 604800) + 604800), "/")[1] + "_" + $string_utils:explode(ctime(time() - (time() - 1041415200 - (time() - 1041415200) / 604800 * 604800) + 604800), " ")[5] + ".log"; endif "-- handles the month2month case --"; if (this.dwm[x] == "month") choices[4][2] = "Aloha_" + $string_utils:explode(ctime())[2] + $string_utils:explode(ctime())[5] + ".log"; endif endfor endif for y in [1..length(choices)] if ($hash_utils:fetch(choices, choices[y][1]) != "") file_name = choices[y][2]; call_function("fileappend", this.log_dir, file_name, {" "}); call_function("fileappend", this.log_dir, file_name, {"**********************************************"}); call_function("fileappend", this.log_dir, file_name, {ctime()}); for x in [1..length(input)] ticks_left() < $kahuna.ticks_threshold && suspend(0); call_function("fileappend", this.log_dir, file_name, {input[x]}); endfor call_function("fileappend", this.log_dir, file_name, {"**********************************************"}); endif endfor endif endif return; endif . @verb Aloha_log:"save_error_log" this none this @program Aloha_log:save_error_log "-- called by Aloha_log:error() --"; if (caller != $kahuna) return E_PERM; else {error_type, object} = args; object_found = error_type_found = 0; for x in [1..length(this.error_log)] (ticks_left() < $kahuna.ticks_threshold) && suspend(0); if (error_type == this.error_log[x][1]) error_type_found = 1; for y in [2..length(this.error_log[x])] (ticks_left() < $kahuna.ticks_threshold) && suspend(0); if (object == this.error_log[x][y][1]) this.error_log[x][y][2] = this.error_log[x][y][2] + 1; object_found = 1; endif endfor if (object_found == 0) "-- we have a new object with this type of error --"; this.error_log[x] = {@this.error_log[x], {object, 1}}; endif endif endfor if (error_type_found == 0) "-- we have an occurence of a new type of error --"; this.error_log = {@this.error_log, {error_type, {object, 1}}}; endif endif . @verb Aloha_log:usage this none this @program #100:usage env = args[2]; page = {}; page = {@page, ""}; page = {@page, " "}; page = {@page, " Usage and Statistics for Aloha Web Server"}; page = {@page, @$kahuna:create_headers(env)}; page = {@page, " "}; page = {@page, ""}; page = {@page, "
"}; page = {@page, ""}; page = {@page, " "}; page = {@page, $string_utils:from_list({" "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, "
"})}; page = {@page, "
    "}; page = {@page, "
      "}; page = {@page, "
      Usage and Statistics for Aloha Web Server"}; page = {@page, $string_utils:from_list({"
      For ", $network.MOO_name, " running on ", $network.site, " through ", tostr($kahuna.port), ".", "

      "})}; page = {@page, "
    "}; page = {@page, "
"}; page = {@page, "
"}; page = {@page, "
"}; page = {@page, "
"}; page = {@page, ""}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, $string_utils:from_list({" "})}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, $string_utils:from_list({" "})}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, $string_utils:from_list({" "})}; page = {@page, " "}; page = {@page, "
Type of RequestsNumber of Requests
Incoming Hits from GET Method", tostr(this.incoming_get_packets), "
Incoming Hits from POST Method", tostr(this.incoming_post_packets), "
Outgoing Web Pages served", tostr($kahuna.outgoing_packets), "
"}; page = {@page, "
"}; page = {@page, "

"}; page = {@page, "
"}; page = {@page, ""}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; page = {@page, " "}; for x in [1..length(this.error_log)] ticks_left() < $kahuna.ticks_threshold && suspend(0); page = {@page, $string_utils:from_list({" "}; for y in [2..length(this.error_log[x])] ticks_left() < $kahuna.ticks_threshold && suspend(0); if (toint(this.error_log[x][y][1]) != 0) page = {@page, $string_utils:from_list({" "})}; else page = {@page, $string_utils:from_list({" "})}; endif page = {@page, $string_utils:from_list({" "})}; page = {@page, " "}; endfor endfor page = {@page, "
Error TypeObject/Name TargetedNumber of times
", this.error_log[1][1], " ", $string_utils:explode($hash_utils:fetch($kahuna.error_types, this.error_log[1][1]), "&")[1]})}; for z in [1..length(this.error_log[x]) - 1] ticks_left() < $kahuna.ticks_threshold && suspend(0); page = {@page, "
"}; endfor page = {@page, "
", toobj(this.error_log[x][y][1]).name, " (", tostr(toobj(this.error_log[x][y][1])), ") ", "", this.error_log[x][y][1], "", tostr(this.error_log[x][y][2]), "
"}; page = {@page, "
"}; page = {@page, "
"}; page = {@page, "
"}; page = {@page, "

Copyright © 2001-2003 Aloha Web Server

"}; page = {@page, ""}; page = {@page, ""}; $kahuna:ok(page); .