Arbitrarily writing *ALL* errors to the database is in fact *NOT* a good idea.
Interesting things happen when connections to the database fail.
-Lee
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
November 04, 2007 12:14am
Subscribe [0]#1 / Nov 04, 2007 12:14am
Arbitrarily writing *ALL* errors to the database is in fact *NOT* a good idea.
Interesting things happen when connections to the database fail.
-Lee
#2 / Nov 04, 2007 12:25am
Back story…
I have been hosting a charity site for some college kids… so they had this programmer write them an app for their project, but he does’nt live here and I did not feel like giving him shell access to my server to read logs (Seems shady like….)
So he wrote a function that writes all errors to his database, so he can retrieve them via RSS… actually kinda sweet.
So he sends it to the college kids to upload to me, I provided them with the info ahead of time for the DB… however the connection string was still localhost blah blah etc… I uploaded it without checking….(Not being paid for it)
So they browse to the site…
I swear I am balder….
I had no idea the script tried to write errors to the database.
I also assumed this programmer was somewhat logical in his approach to coding.
So in the end when I finally figured out what the hell was going on, I wrote an if then else to check for db connection before trying to write to the database
You see the issue there right?
Tries to connect to the database and fails, tries to write that failure to the database and fails, tries to write that failure to the database…...................
#3 / Nov 04, 2007 12:30am
I almost pissed myself!
#4 / Nov 04, 2007 3:21am
What happens after it tries to write the failure to the database and fails?
#5 / Nov 04, 2007 4:35am
love it lee!
#6 / Nov 04, 2007 7:45am
Thats one way to make server go boom. We need to start compiling lists of how NOT to crash your server in CI. I found a few… :-$