Re: htdig: htsearch logging problem


Geoff Hutchison (ghutchis@wso.williams.edu)
Thu, 21 Jan 1999 23:55:45 -0400


At 7:37 PM -0400 1/21/99, Doug wrote:
>patch I could test it to see if it helps, but I won't be able to work on
>it myself (which isn't saying much given my lack of C++ ability :).

This is from the latest CVS tree, so it will probably require some fuzz to
apply correctly:

diff -u -r1.35 -r1.39
--- htdig3/htsearch/Display.cc 1999/01/20 19:18:54 1.35
+++ htdig3/htsearch/Display.cc 1999/01/22 04:40:57 1.39
@@ -1263,21 +1278,28 @@
 void
 Display::logSearch(int page, List *matches)
 {
- // Currently unused char *env_host;
     // Currently unused time_t t;
     int nMatches = 0;
     int level = LOG_LEVEL;
     int facility = LOG_FACILITY;
+ char *host = getenv("REMOTE_HOST");
+ char *ref = getenv("HTTP_REFERER");
+
+ if (host == NULL)
+ host = getenv("REMOTE_ADDR");
+
+ if (ref == NULL)
+ *ref = '-';

     if (matches)
        nMatches = matches->Count();

     openlog("htsearch", LOG_PID, facility);
     syslog(level, "%s [%s] (%s) [%s] [%s] (%d/%s) - %d -- %s\n",
- getenv("REMOTE_HOST"),
+ host,
           input->exists("config") ? input->get("config") : "default",
           config["match_method"], input->get("words"), logicalWords.get(),
           nMatches, config["matches_per_page"],
- page, getenv("HTTP_REFERER")
+ page, ref
           );
 }

>announce a "Hey, take a look at this!" type post, and if not can someone
>point me to one? :) We'd also like to be included in the list of sites
>that use htdig if that's appropriate.... the boss is *really* happy with

Sure you can announce that. I don't think anyone will mind. As for the
list, I suggest filling out the handy form on
http://www.htdig.org/uses.html ;-)

-Geoff Hutchison
Williams Students Online
http://wso.williams.edu/

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Mon Jan 25 1999 - 08:15:24 PST