Jump to content

Global setting to log all mysql errors (and/or queries)?


LLLLLLL

Recommended Posts

On MySQL 5.1.47, PHP 5.2.14.

 

Is there a way to somehow send all mysql errors or queries to a log? I'd like to do this in a global manner, not query-by-query.

 

I just changed some major functionality, and there are no PHP errors in the error log, but data is missing from the DB so I'm sure there's a mysql error somewhere. So a global setting is clearly ideal here!

Your application code (php) should have error checking and error reporting logic in it. That logic would then be logging problems or making use of php's built in error logging through a function like trigger_error

The mysql query log (assuming it is on) shows the actual queries. It does not show the result.

 

The mysql error log only shows server errors, not query errors (as far as I can tell when I tested with queries that produced things like duplicate keys, queries without data for fields that don't have defaults values...)

 

Query errors are application level information and it is the responsibility of the application to handle them.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.