Welcome Guest, Not a member yet? Register   Sign In
Django-like errors via email
#1

[eluser]lbolognini[/eluser]
Hi guys,

is there some sort of setting that might give me django-like errors via email when i deploy to production?

What i specifically mean is that i'd like all 500s and 404s to be emailed along with the stacktrace. What's the best way to do this in CI/PHP

Thanks,
L.
#2

[eluser]Derek Allard[/eluser]
Are 500s and 404s emails that got rejected? CI doesn't have this ability nativly sorry, but for individual emails you always have assess to echo $this->email->print_debugger();
#3

[eluser]lbolognini[/eluser]
[quote author="Derek Allard" date="1238873974"]Are 500s and 404s emails that got rejected? CI doesn't have this ability nativly sorry, but for individual emails you always have assess to echo $this->email->print_debugger();[/quote]

Hey Derek,

thanks for taking the time to chime in on this.

Well, so how do you guys know which errors happened on your production apps? Do you always have to log on the shell to check the errors.log?

These reports are IMO really invaluable: reason being that most users of your site will not report you errors, they'll just go away and leave you with a broken app.

This is the piece of Django doc that explains how it works:
http://docs.djangoproject.com/en/dev/top...middleware

Basically whenever an exception is met if DEBUG=False then it sends emails to all users in the ADMIN setting variable.

Sorry to keep making comparisons: i come from a Django background and have been lured to CI by its ease of deployment which i need for the project i'm working on. Trying to setup a Django-like environment because that's what i grew accustomed to.

L.
#4

[eluser]Derek Allard[/eluser]
I'm confused. What errors specifically are you trying to check for?

That the email was successfully sent? - That would be trivially added in.

That the email was successfully recieved? - I have no idea how this could possibly be tracked.
#5

[eluser]lbolognini[/eluser]
[quote author="Derek Allard" date="1238875266"]I'm confused. What errors specifically are you trying to check for?
[/quote]

I'm not talking about specific errors. I'm talking about HTTP 500 and 404 errors: i'd like to kill all error notification to the end-user but still receive the errors by email.

Django allows me to do this by setting a variable in the settings.py file to DEBUG=False this way end-users see a friendly HTTP 500/400 page and i get notified of the errors by email.

A typical error report would look like this:

http://dpaste.com/hold/23841/

This feature has sometimes allowed me to fix the issues before the customer contacted me.

L.
#6

[eluser]Derek Allard[/eluser]
I understand, this isn't about email per se, that was just your example. Yes, CI has a logging class - take a trip through the docs ibolognini.

Welcome to CI!
#7

[eluser]lbolognini[/eluser]
[quote author="Derek Allard" date="1238876231"]I understand, this isn't about email per se, that was just your example. Yes, CI has a logging class - take a trip through the docs ibolognini.

Welcome to CI![/quote]

Ok thanks, after you posted this i found this reply on Stackoverflow:

http://stackoverflow.com/questions/26059...iled-to-me

L.




Theme © iAndrew 2016 - Forum software by © MyBB