"No connection to DB" message / Mail to admin

Author Message

Marco Zinn

Sunday 17 August 2008 10:32:40 am

Hi there,

i found out, that ez (3.10) shows a quite unuseful message (I think, it was "You don't have access to this page, please log in"), when it cannot connect to it's MySQL db.
To be precise, the DB did no allow the connection due to to many connections at that time. I can see that very nicely in ez's error log.

Why does ez not show a better message here like the famous "Can't connect to Database"?

A related question: Is there any way to send an email notification to the admin in case of severe errors? A kind of "plugin" to the error-logging would be nice. Something like "If error message contains "Database" or "XYZ", send mail to me@admin.com". I guess, this is not part of ez yet, but i also guess, somebody already has created this... im a right ;) ?

Marco
http://www.hyperroad-design.com

Maxime Thomas

Thursday 04 September 2008 12:01:33 am

Hi Marco,

You can handle the errors by overriding the error.ini file. The No connection DB is the error number 50, you may handle it to a new extension which will send emails.

Hope it helps.

Max

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:16:35
Script start
Timing: Jan 31 2025 06:16:35
Module start 'layout'
Timing: Jan 31 2025 06:16:35
Module start 'content'
Timing: Jan 31 2025 06:16:35
Module end 'content'
Timing: Jan 31 2025 06:16:35
Script end

Main resources:

Total runtime0.0134 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2578151.2266
Module start 'layout' 0.00480.0023 739.484436.6797
Module start 'content' 0.00710.0049 776.164190.1563
Module end 'content' 0.01190.0014 866.320333.9922
Script end 0.0133  900.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002317.0718140.0002
Check MTime0.00118.0173140.0001
Mysql Total
Database connection0.00085.606210.0008
Mysqli_queries0.002216.138030.0007
Looping result0.00000.112310.0000
Template Total0.00107.410.0010
Template load0.00085.732810.0008
Template processing0.00021.675110.0002
Override
Cache load0.00054.014910.0005
General
dbfile0.00107.536280.0001
String conversion0.00000.067740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs