[mod_python] Processing Apache Logs

Orr, Steve sorr at rightnow.com
Wed Oct 6 18:18:33 EDT 2004


OK, I got some custom logging to a database working and I can pretty
much capture anything generated by "normal" Apache logging except... I
don't see any equivalent to the Apache directive like LogFormat "%T %D"
where %T and %D are the respective times to serve the HTTP requests in
seconds and microseconds.
 
Is there any reason the PythonLogHandler doesn't pick this up from the
Apache logging phase? Am I stuck because there's "no way to get there
from here?"
 
Please advise and TIA! TIA! TIA! ...
D. B. Dweeb
 
 

	-----Original Message-----
	From: mod_python-bounces at modpython.org
[mailto:mod_python-bounces at modpython.org] On Behalf Of Orr, Steve
	Sent: Wednesday, October 06, 2004 8:28 AM
	To: Jaco Smuts
	Cc: mod_python user mailing list
	Subject: RE: [mod_python] Processing Apache Logs
	
	
	Yes, we're actually using it in a limited way. It's pretty good
but our data warehouse needs to be in Oracle. Currently we use mod_sql
to capture the data into MySQL then copy subsets of data to Oracle. 
	 
	I was looking at mod_python's access to the Apache internals and
it looks like the various attributes (members) of the request,
connection, and server objects would contain everything needed to
capture the Apache log data (and more?) so I'm thinking the
PythonLogHandler could be used to get this data and put it into a
database as mentioned in the ONLamp Python DevCenter article,
(http://www.onlamp.com/pub/a/python/2003/10/02/mod_python.html). 
	 
	Quote:

		"Mod_python provides the ability to register for any
phase and write the processing function in Python. This is a very
powerful feature, because it opens the door for many innovative and
exciting ways to use Apache. For example, you can write Python code to
do authentication processing or custom logging (perhaps sending logs to
a database while maintaining real-time statistics)."

	This is all new to me and I need an example to get started with
the PythonLogHandler. So... it would be nice to have a quick and dirty
example to backup the claim in the article.  :-)
	 
	 
	With admiration for the mod_python project,
	D. B. Dweeb, AKA Steve Orr
	 
	 

		-----Original Message-----
		From: Jaco Smuts [mailto:JSmuts at clover.co.za] 
		Sent: Wednesday, October 06, 2004 12:55 AM
		To: Orr, Steve
		Cc: mod_python user mailing list;
mod_python-bounces at modpython.org
		Subject: Re: [mod_python] Processing Apache Logs
		
		

		Have you  looked at mod_sql ? 
		
		jaco 
		
		
		
		
		
"Orr, Steve" <sorr at rightnow.com> 
Sent by: mod_python-bounces at modpython.org 

10/05/2004 08:08 PM 

To
"mod_python user mailing list" <mod_python at modpython.org> 
cc
Subject
[mod_python] Processing Apache Logs	

		




		The ONLamp "Introducing mod_python" article mentions the
possibility of
		doing custom Apache logging with mod_python and
inserting log data
		directly to a database. Are there any examples of this
or has anyone on
		this list done such a thing? Any guidance or
suggestions?
		
		I'm looking at building a data warehouse from the Apache
log output. The
		web apps on the load balanced web servers to be
monitored do not use any
		Python code. Are there 3rd party (non-Pythonic perhaps)
log parser apps
		I should look at instead of cutting my own mod_python
code? 
		
		
		AtDhVaAnNkCsE,
		D. B. Dweeb
		
		_______________________________________________
		Mod_python mailing list
		Mod_python at modpython.org
		http://mailman.modpython.org/mailman/listinfo/mod_python
		
		

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://modpython.org/pipermail/mod_python/attachments/20041006/763a3e22/attachment.html


More information about the Mod_python mailing list