A plugin for capturing exceptions using the [raygun](https://raygun.com) service.
As of 1.0.0 this extention has been made to work with CKAN 2.9. While attempts have been made to maintain compatibility with prior version of CKAN, there may be issues. If any issues are discovered we are happy to accept PRs. Alternatively for compatibility <2.9 the 0.1.0 tag can be used
We know this works with CKAN 2.9, if you are installing it in a prior version we would appreciate your contributions in supporting backwards compatibility.
To install ckanext-raygun:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-raygun Python package into your virtual environment:
pip install ckanext-raygun
Add
raygun
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Configuration of this plugin happens through standard python logging config and via a wsgi specific middleware that picks up the ckanext.raygun.api_key config field:
# The api key for accessing raygun ckanext.raygun.api_key = <your_api_key_here> # Optionally, set RaygunSender config (see raygun4py README for more info) ckanext.raygun.sender_config = {} # To support ad-hoc paster commands reporting to raygun add the following handler to your log config # 1. extend your handlers definition [handlers] keys = console, raygun [logger_root] level = WARNING handlers = console, raygun # 2. configure a handler for raygun [handler_raygun] class = ckanext.raygun.plugin.RaygunHandler args = ('<your_api_key_here>', <raygun_sender_config>,) level = NOTSET formatter = generic
To install ckanext-raygun for development, activate your CKAN virtualenv and do:
git clone https://github.com/mediasuite/ckanext-raygun.git cd ckanext-raygun pip install -e . pip install -r dev-requirements.txt
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (pip install coverage
) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.raygun --cover-inclusive --cover-erase --cover-tests