[interchange-cvs] interchange - heins modified lib/Vend/Server.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Fri Jan 30 17:25:05 EST 2004
User: heins
Date: 2004-01-30 22:25:05 GMT
Modified: lib/Vend Server.pm
Log:
* Reinstate http_log_msg for logging SOAP accesses, since there may be no
other place it is logged.
Will consider where this should be -- we probably need a "LogDir" directive
in the global.
What would make more sense is a complete upgrade to the logging capability
of Interchange. I have been considering working on this for some time;
it would make sense for all logs to have multiple ways of being entered
(DBI, syslog, files in globally controlled tree, standard local file).
Revision Changes Path
2.46 +29 -2 interchange/lib/Vend/Server.pm
rev 2.46, prev_rev 2.45
Index: Server.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.45
retrieving revision 2.46
diff -u -r2.45 -r2.46
--- Server.pm 30 Jan 2004 13:17:36 -0000 2.45
+++ Server.pm 30 Jan 2004 22:25:05 -0000 2.46
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.45 2004/01/30 13:17:36 racke Exp $
+# $Id: Server.pm,v 2.46 2004/01/30 22:25:05 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
package Vend::Server;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.45 $, 10);
+$VERSION = substr(q$Revision: 2.46 $, 10);
use POSIX qw(setsid strftime);
use Vend::Util;
@@ -700,6 +700,25 @@
}
+sub http_log_msg {
+ my($status, $env, $request) = @_;
+ my(@params);
+
+ # IP, Session, REMOTE_USER (if any) and time
+ push @params, ($$env{REMOTE_HOST} || $$env{REMOTE_ADDR});
+ push @params, ($$env{SERVER_PORT} || '-');
+ push @params, ($$env{REMOTE_USER} || '-');
+ push @params, logtime();
+
+ # Catalog name
+ push @params, qq{"$request"};
+
+ push @params, $status;
+
+ push @params, '-';
+ return join " ", @params;
+}
+
sub http_soap {
my($fh, $env, $entity) = @_;
@@ -776,6 +795,14 @@
#::logDebug("found catalog $catname");
$$env{SCRIPT_NAME} = $catname;
}
+
+ logData("$Global::VendRoot/etc/access_log",
+ http_log_msg(
+ "SOAP$status",
+ $env,
+ ($$env{REQUEST_METHOD} . " " . $request),
+ )
+ );
populate($env);
map_misc_cgi();
More information about the interchange-cvs
mailing list