Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // index.php
- $ci = & get_instance();
- $handle = fopen('slow_query_1.log', "a+");
- $handle_slow = fopen('slow_query_10.log', "a+");
- foreach($ci->db->queries as $key =>$query)
- {
- $time = number_format($ci->db->query_times[$key], 4);
- if ($time < 1)
- continue;
- if ($time < 10)
- {
- fwrite($handle, date('j.m.Y G:i:s').' : '.$time."\r\n");
- fwrite($handle, $query."\r\n\r\n-----------------------------\r\n");
- }
- else
- {
- fwrite($handle_slow, date('j.m.Y G:i:s').' : '.$time."\r\n");
- fwrite($handle_slow, $query."\r\n\r\n-----------------------------\r\n");
- }
- }
- fclose($handle);
- fclose($handle_slow);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement