Stop writing a few hundred log lines per request
Every neighbourhood request printed one line per window position, one per
vocabulary lookup, the whole JSON of a similar profile and the comings and
goings of the worker threads. Together with the crawler traffic that came
to about a million lines a day on corpora.ids-mannheim.de, which is what
filled the log partition of the machine.
Those diagnostics are behind DEREKOVECS_DEBUG now, and the per request
narration of the perl side, which repeated what the access log line of the
same request already says, is logged at debug level. What is left in the
default configuration is one line per request, plus the user agent of a
request that was turned away as a crawler.
Startup messages, the model mapping and error messages are untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I4059a1db5ba59a59da6177225c6f66ff53ddcaec
diff --git a/script/derekovecs-server b/script/derekovecs-server
index bc66b01..9f5dbec 100755
--- a/script/derekovecs-server
+++ b/script/derekovecs-server
@@ -222,7 +222,7 @@
my $c = shift;
my $url = $c->req->url;
$url =~ s@/derekovecs/@/@g;
- $c->app->log->info("GET: " . $url);
+ $c->app->log->debug("GET: " . $url);
$c->reply->static($url);
} => 'js';
@@ -230,7 +230,7 @@
my $c = shift;
my $url = $c->req->url;
$url =~ s@/derekovecs/@/@g;
- $c->app->log->info("GET: " . $url);
+ $c->app->log->debug("GET: " . $url);
$c->reply->static($url);
} => 'css';
@@ -412,13 +412,13 @@
my $c = shift;
my $url = $c->req->url;
$url =~ s@/derekovecs@@g;
- $c->app->log->info("GET: " . $url);
+ $c->app->log->debug("GET: " . $url);
$c->reply->static($url);
};
get '/' => sub {
my $c = shift;
- $c->app->log->info("get: ".$c->req->url->to_abs);
+ $c->app->log->debug("get: ".$c->req->url->to_abs);
my $word=$c->param('word');
my $no_nbs=$c->param('n') || ($opt_m? 50 : 100);
my $no_iterations=$c->param('N') || 2000;
@@ -452,9 +452,9 @@
my $key = join("\x1c", $w, $cutoff, $no_nbs, $sort, $dedupe, $searchBaseVocabFirst, $nosp);
$res = $opt_C ? undef : $cache->get($key);
if (defined $res) {
- $c->app->log->info("Getting $w results from cache");
+ $c->app->log->debug("Getting $w results from cache");
} else {
- $c->app->log->info('Looking for neighbours of '.$w);
+ $c->app->log->debug('Looking for neighbours of '.$w);
if($opt_i) {
$res = get_neighbours(encode("iso-8859-1", $w), $no_nbs, $sort, $searchBaseVocabFirst, $cutoff, $dedupe, $nosp);
} else {