sql; $bindings = $event->bindings; // Format binding data for sql insertion foreach ($bindings as $i => $binding) { if ($binding instanceof DateTime) { $bindings[$i] = $binding->format('\'Y-m-d H:i:s\''); } else { if (is_string($binding)) { $bindings[$i] = "'$binding'"; } } } $time = $event->time; $connection = $event->connectionName; $data = compact('bindings', 'time', 'connection'); // Insert bindings into query $query = str_replace(array('%', '?'), array('%%', '%s'), $query); $query = vsprintf($query, $bindings); Log::info($query, $data); //trace if (Config::get("server.db_log_trace_enabled", false)){ $trace = ''; $entries = debug_backtrace(); unset($entries[0]); foreach ($entries as $entry) { if (!isset($entry['file']) || !isset($entry['line'])) continue; $trace .= $entry['file'] . ' ' . $entry['line'] . PHP_EOL; } Log::debug($trace); } } } }