Roel
Roel

Reputation: 1472

PHP Logging error messages

I am using the CodeIgniter MVC framework. This framework contains the option to log errors. I prefer to not change anything in the core of the framework. So I am kinda having my doubts on using the default logging of the system, as this will also add PHP notices to the log files.

Is it wise to not use the CI logging and create my own logging system (adding the logs to the database, for example)?

Thanks in advance.

Upvotes: 2

Views: 1279

Answers (1)

stefandoorn
stefandoorn

Reputation: 1032

Probably the better option is to extend the CI logging system with your own functionality if you want to do this. The CI logging is pretty good, and it also logs your PHP errors if you want. Besides that, when extending, you can easily add options to it like:

  • Saving the data to the database
  • Sending an e-mail with the log information to yourself

There are good examples to do things like that, e.g.:

You can also adjust an example like that to also save the information to your database, or whatever you want to do with it..

Upvotes: 7

Related Questions