Having troubles with logs |
[eluser]Unknown[/eluser]
Hello everybody, I'm quite new to CodeIgniter, forgive me if my questions sound a bit foolish ![]() I do actually have two issues. 1) I activated logging through the config file, and it works well, a bit too well actually, everytime I load a page, it generates about 2 to 3 hundreds of lines. When I took a look into my log files, I realized than more than the half of those lines were : DEBUG - 2009-10-16 17:38:09 --> Model Class Initialized After investigating around a bit, I realized that everytime I instanciate (e.g. new Order() ) an object, it generates a line. I'm currently asking myself if this is normal. I find it strange that everytime I intanciate an object it loads the Model Class. 2) I'm dealing with Orders and Customers in my application. I would like to log business logs. Something like : Customer John paid his order at 2009-10-20 12:23:39 I don't know how to do that, I get so many logs from the system than these important logs would get lost in the huge amount of data. I could set them as error message and then edit my config file, but it sounds wrong to me. Shoud I use a external logging engine ? or develop my own logging library ? I hope that someone experienced the same problems and could share his answers with me ![]() Have a nice day, R.G. from Switzerland
[eluser]rogierb[/eluser]
Hi, The amount of logging is normal when you have set the logging to debug. In a live environment, set the logging to 0 or maybe 1. Debugging is just for debugging in a development environment. As for custom logs, there are several options like writing you own library. You might want to think about extending or copying the current CI_Log library. A different approach is this thread, where youi log queries.
[eluser]Unknown[/eluser]
Thx for your answer. Glad to hear that I didn't do anything wrong in my code ![]() I'll try to extends or copy the Log library. Thanks for your help |
Welcome Guest, Not a member yet? Register Sign In |