 |
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.
|