4

Magento is logging SQL queries even after I turned logging off in /lib/Varien/Db/Adapter/Pdo/Mysql.php. Wondering if there's something I'm missing?

These are the spots that are set to false:

    protected $_debug               = false;

/**
 * Minimum query duration time to be logged
 *
 * @var float
 */
protected $_logQueryTime        = 2.5;

/**
 * Log all queries (ignored minimum query duration time)
 *
 * @var bool
 */
protected $_logAllQueries       = false;

/**
 * Add to log call stack data (backtrace)
 *
 * @var bool
 */
protected $_logCallStack        = false;

/**
 * Path to SQL debug data log
 *
 * @var string
 */
protected $_debugFile           = 'var/debug/pdo_mysql.log';

I need to regularly delete var/debug/pdo_mysql.log or it will grow to several gigs in size.

Debug mode is disabled in the admin area (System - Configuration - Developer - Debug set to no).

Looking for some advice. Thanks in advance

2
  • if this is the only file was modified, then i guess opcode cache?
    – user2857
    Commented Dec 26, 2014 at 22:39
  • I've inherited a site with this exact issue - did you ever find a solution? Commented Apr 28, 2015 at 14:43

2 Answers 2

2

This logging should be off by default in a clean install of magento so it sounds like someone has previously modified this file to turn this setting on.

That said, now that logging is disabled I see no reason why the PDO adapter should be logging queries. As suggested above if you are using APC or opcache try clearing that as because this is a change to a php file rather than a db setting it may be cached at the php level.

2
  • Yes, $_debug = false turns off all logging to pdo_mysql.log. So it's either APC or the class has been overridden in app/code/{core|local|community}/Varien/Db/Adapter/Pdo/Mysql.php Commented Feb 20, 2015 at 10:21
  • @fschmengler - I've checked both of these ideas but the log is still being generated. Do you have any other idea where the debug option could be getting overridden? Thanks. Commented Apr 29, 2015 at 8:41
0

Debug mode might be on. Go to System - Configuration - Developer - Debug and if the Profiler is set to Yes, disable it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.