We have some custom logs that we maintain in the database (mysql). We use these logs to keep track of recent errors and email activity in our zend framework application.
We found out recently that these logs create some stress on the database, as we perform multiple read / writes on these log tabs. It's also slows down the application, as we need to perform mysql INSERTs, and sometimes these log tables get locked by other SELECT queries.
We use Zend_Log
adapters to perform the log writes, as such:
$columnMapping = array('url' => 'url', 'userAgent' => 'userAgent', 'info' => 'info', 'reffer' => 'reffer', 'userId' => 'userId', 'priority' => 'priority','dateInserted' => 'dateInserted', 'message' => 'message');
$writer_db = new Zend_Log_Writer_Db($db, 'log', $columnMapping);
We also have a custom cronjob that cleans out old entries from the log each night, which also creates some stress on the database.
The only requirement we have for these logs, is that they should be searchable from a central location, as we have multiple servers writing these logs.
Any alternative for writing logs in a zend framework application? any good Zend_Log
adapters that can help in this case?