![]() |
CI logging: Two rounds of CI logs for each page load? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI logging: Two rounds of CI logs for each page load? (/showthread.php?tid=30981) |
CI logging: Two rounds of CI logs for each page load? - El Forum - 06-02-2010 [eluser]Nick Jennings[/eluser] Hi All, I'm currently debugging a CI app that I did not develop. Some strange behavior lead me to have a look at the CI logs, and I noticed that for each "reaload" of a page, I was getting seemingly two run-throughs of logs (two groups of info both ending in their own "Total execution time" statistic). I thought this was specific to the application, so I tested it on my test install of CI, and low-and-behold I got the same results. It seems any errors I get, I get twice in the logs. Here is an example of what showed up in the logs after a single page reload on my local CI app: Code: DEBUG - 2010-06-02 14:32:45 --> Config Class Initialized Is this normal? If so could someone explain to me whats going on here so I can better understand and debug my applications? Thanks, Nick CI logging: Two rounds of CI logs for each page load? - El Forum - 06-02-2010 [eluser]n0xie[/eluser] This usually happens when you try to load a file that isn't there. Remember that all the requests go through index.php so if a 404 occurs it still goes through the index.php. You see that it are 2 different requests: Code: DEBUG - 2010-06-02 14:32:45 --> URI Class Initialized Code: DEBUG - 2010-06-02 14:32:45 --> URI Class Initialized CI logging: Two rounds of CI logs for each page load? - El Forum - 06-02-2010 [eluser]Nick Jennings[/eluser] Hi n0xie, Thanks for the reply. That makes sense, I wasn't thinking about calls back to other CI functions from within the view. (in this case, to display a thumbnail from a db record). Thanks again! -nick CI logging: Two rounds of CI logs for each page load? - El Forum - 06-02-2010 [eluser]Nick Jennings[/eluser] Quick secondary question, isn't there a way to logs which controllers and controller methods are called on a request? This debug output is all very general and not very informative. CI logging: Two rounds of CI logs for each page load? - El Forum - 06-02-2010 [eluser]WanWizard[/eluser] Hook into the pre_controller hook, and add Code: log_message('debug', 'routing to '.$this->router->fetch_class().'::'.$this->router->fetch_method().'()'); CI logging: Two rounds of CI logs for each page load? - El Forum - 06-07-2010 [eluser]Nick Jennings[/eluser] Thanks! |