Query value logging fix

Fix the query logging so that both the query and values can be sent in a single log method call.

Since the logging is based around the Pear::Log module where the log() method only takes one argument, our original way of doing this didn't work because passing the values as the 2nd arg to the method causes anything not using our framework debugger method to blow up.

So kept things compliant, and just pass a json encoded string as the log data, where the JSON contains both the query and the values.

Ultimately I'd like to update this to match the PSR-3 compliant logging so a $context array can be passed to the logger method, but this requires massive updates in PHP-AR itself - so not for now.  Maybe another day when there is more free time.