Welcome Guest, Not a member yet? Register   Sign In
CI logging performance
#1

[eluser]Adrian Walls[/eluser]
Apologies if this question has already been asked but I had a quick search and couldn't find anything. From what I can see in the fourms there are several issues with the performance of CI logging and its been suggested that the CI logging is to be used more for development purposes rather than as a logging mechamism in a production environment.

Therefore my question is if I have for example lots of debug messages littered throughout my code and I release this code to my production server with logging set to error, is there a hit on performance as CI obvioulsy has to check each log statement in the code to decide if it needs to write it to the log file it or not.
#2

[eluser]garymardell[/eluser]
I think the main concern is when people leave logging on and you get hundreds of people visit the site and on every page load of your site a whole new chunk will be written to your log file. You can see how this would soon get out of hand and make an incredibly large file.

I think its probably best to turn logging off completely on a production site. The reason for this, unless you sit there watching your log file for errors then it is more likely that someone will email you or reply to the forum post with it before you see it in the log. It also means you don't have to do house keeping on all the log files. The only reason i can see it being useful if you had a script that get the errors from the log file and alerts you to them at the end of the day by email or display them in an admin panel.
#3

[eluser]Adrian Walls[/eluser]
Every one will have a different approach as to how they deal with logging and catching errors in their applications/websites. That's not really my question here. Personally I still want to log errors as they are very useful to see exactly what a user was doing in my application at the point they encountered an error therefore making it easier for me to replicate and investigate the problem.

So regardless of the argument as to whether logging is disabled or not and going back to my original question taking an example where logging is completely switched off and I have lots of debug messages throughout my code, Is there a performance hit with checking the log level before skipping over the log statement as CI still has to determine if needs to log the message or not.




Theme © iAndrew 2016 - Forum software by © MyBB