Elasticsearch Sentry Happy Days

Title: elasticsearch + sentry = happy days Date: 2013-05-21 15:06 Author: eamonnfaherty Category: devops Tags: elasticsearch, sentry Slug: elasticsearch-sentry-happy-days

I have been using the amazing Sentry for quite some time and I love it. For anybody running a live site it really is a must!

I have also recently switched from xapian to elasticsearch as my search engine of choice.

BTW, I am on Ubuntu 12.04, installed elasticsearch via a deb file downloaded from their site and installed sentry via pip.

Once I was all setup I wanted to enabling logging of elasticsearch to my centralised sentry instance. This was a real pain and would have taken me a lot longer to complete (if at all) if it wasn’t for ColinHebert - details. Thanks again!

Here is what I had to do to get it working:
Elasticsearch uses log4j for logging but has a yaml file to configure it instead of a properties file. I had to append this to my /etc/elasticsearch/logging.yml file:

sentry: type: net.kencochrane.raven.log4j.SentryAppender dsn: "http://XXXX:YYY@myserver.com/N"

I also change the first line to read:
rootLogger: DEBUG, console, file, sentry

All I did was append sentry to the list of rootLoggers.

Once the config was sorted I had to download the dependencies:
raven-3.0-20130516.191912-9.jar
raven-log4j-3.0-20130516.191940-9.jar
commons-codec-1.8.jar
jackson-core-2.2.2-20130512.040915-3.jar
slf4j-api-1.7.5.jar

and add them to /usr/share/elasticsearch/lib on the machine hosting elasticsearch.

Once that was all done restarting elasticsearch was all that remained and I was logging to sentry!

Published: May 21 2013

  • category:
  • tags:
blog comments powered by Disqus