Development

Changeset 6804

You must first sign up to be able to contribute.

Changeset 6804

Show
Ignore:
Timestamp:
12/29/07 06:45:22 (1 year ago)
Author:
dwhittle
Message:

dwhittle: tweaked sql debug logging

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.1/lib/debug/sfWebDebug.class.php

    r6738 r6804  
    101101    $logLine = preg_replace('/\b(SELECT|FROM|AS|LIMIT|ASC|COUNT|DESC|WHERE|LEFT JOIN|INNER JOIN|RIGHT JOIN|ORDER BY|GROUP BY|IN|LIKE|DISTINCT|DELETE|INSERT|INTO|VALUES)\b/', '<span class="sfWebDebugLogInfo">\\1</span>', $logLine); 
    102102 
    103     // remove username/password from dsn 
    104     if (stripos($logLine, 'dsn') !== false) 
    105     { 
    106       $logLine = preg_replace("/=&gt;\s+'?[^'\s,]+'?/", "=&gt; '******'", $logLine); 
    107     } 
    108  
    109103    return $logLine; 
    110104  } 
     
    171165 
    172166        // sql queries log 
    173         if (preg_match('/execute(?:Query|Update).+?\:\s+(.+)$/', $log, $match)) 
     167        if (preg_match('/\b(SELECT|INSERT|UPDATE|DELETE)\b/', $log, $match)) 
    174168        { 
    175           $sqlLogs[] .= $match[1]
     169          $sqlLogs[] .= $log
    176170        } 
    177171 
  • branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/log/sfPropelLogger.class.php

    r6772 r6804  
    117117  public function log($message, $severity = sfLogger::DEBUG) 
    118118  { 
    119     // get a backtrace to pass class, function, file, & line to logger 
    120     // $trace = debug_backtrace(); 
    121     // sprintf('%s->%s on line %s in file %s', $trace[2]['class'], $trace[2]['function'], $trace[1]['file'], $trace[1]['line']); 
    122  
    123     $message = stripos('SELECT', $message) ? 'executeQuery: '.$message : 'executeUpdate: '.$message; 
    124  
    125119    $this->dispatcher->notify(new sfEvent($this, 'application.log', array($message, 'priority' => $severity))); 
    126120  }