Merge lp://staging/~sinzui/charms/precise/charmworld/error-notifications into lp://staging/~juju-jitsu/charms/precise/charmworld/trunk
Status: | Merged |
---|---|
Merged at revision: | 54 |
Proposed branch: | lp://staging/~sinzui/charms/precise/charmworld/error-notifications |
Merge into: | lp://staging/~juju-jitsu/charms/precise/charmworld/trunk |
Diff against target: |
121 lines (+41/-9) 3 files modified
production_overrides.ini (+10/-5) revision (+1/-1) scripts/write_config.py (+30/-3) |
To merge this branch: | bzr merge lp://staging/~sinzui/charms/precise/charmworld/error-notifications |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+151630@code.staging.launchpad.net |
This proposal supersedes a proposal from 2013-03-04.
Commit message
Email exceptions to a list
Description of the change
This branch adds an SMTP logging handler to the production ini/config.
When set the error-email setting. When error-email is not set, the
NullHandler is used to avoid "missing handler" warnings from the logger.
RULES
Pre-
* Staging only send ingest error email to Aaron. Only he can see that
there is a defect.
* Devs cannot see any exceptions from the staging app. Aaron's ssh
key is required to visit the server and read the error logs.
* We do not want Aaron two be a liability. We do not want to interrupt
Aaron to diagnose an error
* Rick suggests using the SMPT handler via the exc_logger that is already
used by the production ini config.
* We can extend scripts/
error-email setting is define, and send exceptions to that email
address.
* We can create a private team with a mailing list, and use the list
address as the error-email in the config.
QA
* Deploy this charm or upgrade a deployment.
* Instrument an exception --
Hiding removing, or remapping search's path to /var so that it
cannot access the index with. For example.
cd charmworld; HOME=/bogus/path make run
* Verify that no notification was sent for that time in
/
* Configure error-email to test that you receive
juju set charmworld <email address hidden>
* Instrument an exception.
* Verify you get an email with the exception's traceback.
IMPLEMENTATION
There are several points in this implementation that are not ideal. I welcome
advise.
1.Bogus args are set in production_
that looks like the intent, but the real default is a NullHandler.
2. The from address must be from a legitimate domain; canonical's SMTP doesn't
like instance names. The email contains the instance in the exception, so
I hard coded <email address hidden> as the from address.
Since you're overwriting args, I suggest not setting it in production_ overrides. ini at all.