We can log directly to a database and dispense with the log file writing by piping our logs into a program that updates the data in a RDBMS by doing something in our httpd.conf like:
CustomLog ``| /usr/local/apache/bin/dblogger'' dblogformat
or using mod_log_mysql.
Whatever you use, be sure you can recover from a loss of the connection to RDBMS! With log files, as long as there is room on the file system, they just keep writing; losing data due to a dropped RDBMS connection is generally unacceptable! Your dblogger program should at least be tolerant of and adaptive to dropped database connections.
My preference is to increase the frequency of the log rotation and importing the data in near real time but offline from our live http server.
Slide 11 of 18 Contents
  1 |   2 |   3 |   4 |   5 |   6 |   7 |   8 |   9 | 10
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18
www.arachna.com > Educational Resources > Conference Presentations

spidaman
© 1999-2008 Ian Kallen | Copyright Notice