[Gllug] apache logging woes
will
will at hellacool.co.uk
Tue Feb 15 10:54:44 UTC 2005
I have googled, but I just can't see why my apache piped logs don't
work, anyone have any ideas?
I have the following VirtualHost directive in Apache
(http://httpd.apache.org/docs/logs.html#piped):
CustomLog "|/usr/local/sbin/ai_log_parser" combined
This is part of the (very basic) python script 'ai_log_parser':
--------------------------------------------------------
conn = dbConn()
cur = conn.cursor()
sys.stderr.write('before loop')
for input in sys.stdin:
sys.stderr.write('in loop 1')
cur.execute("insert into tmplog (line) values (%s)", (input))
sys.stderr.write('in loop 2')
sys.stderr.write('after loop')
--------------------------------------------------------
This script works when called from the command line (ie. data gets into
the database):
bozotheclown:/etc/apache# echo "poop" | /usr/local/sbin/ai_log_parser
before loopin loop 1in loop 2after loopbozotheclown:/etc/apache#
But when a request is made for a page via apache I get nothing. When
Apache starts I get this in apaches log:
--------------------------------------------------------
[Tue Feb 15 10:19:47 2005] [notice] SIGHUP received. Attempting to restart
[Tue Feb 15 10:19:48 2005] [notice] Apache/1.3.26 (Unix) Debian
GNU/Linux PHP/4.1.2 configured -- resuming normal operations
[Tue Feb 15 10:19:48 2005] [notice] suEXEC mechanism enabled (wrapper:
/usr/lib/apache/suexec)
[Tue Feb 15 10:19:48 2005] [notice] Accept mutex: sysvsem (Default: sysvsem)
before loop
--------------------------------------------------------
So it is obviously running, but that 'before loop' is as far as it gets.
This is on Apache on Debian:
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
Any help would be appreciated.
Will.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list