Code Monkey home page Code Monkey logo

honeybadger-java's Introduction

honeybadger-java

Java Client to report exceptions to Honeybadger.io

By adding the following line to your code(Possibly in the main function). All errors that you don't catch will be caught and sent to honeybadger.

Honeybadger honeybadger = new Honeybadger();

In order for this to work, you must have the following environmental variables set. HONEYBADGER_API_KEY JAVA_ENV

If you are using the log4j appender, JAVA_ENV can be set instead in the log4j.properties file.

HONEYBADGER_API_KEY: Contains your Honeybadger api key. This is found in your projects settings on the Honeybadger web page.

JAVA_ENV: Describes the environment where your program is running. I use development and production.

log4j appender

The HoneybadgerAppender is a log4j appender that reports log messages set to the ERROR level to Honeybadger.

To use it, you will need to add a few lines to log4j.properties in addition to the environment variables required for the Honeybadger Java client. First, add HoneybadgerAppender as a root appender:

log4j.rootLogger=INFO, file, console [...], honeybadger

Then set the appender, passing in sys properties if desired:

log4j.appender.honeybadger=honeybadger.HoneybadgerAppender
log4j.appender.honeybadger.Threshold=ERROR
log4j.appender.honeybadger.HoneybadgerAPIKey=${api_key}
log4j.appender.honeybadger.JavaEnv=${java_env}

Note that, since HoneybadgerAppender instantiates Honeybadger, all uncaught exceptions will also be reported to Honeybadger.

honeybadger-java's People

Contributors

xentek avatar loganmhb avatar

Watchers

Jon Slusher avatar John Jacobsen avatar Andy Dyrcz avatar James Cloos avatar Braden Wright avatar Dan Gonsiorowski avatar  avatar Raman Patsiayuk avatar  avatar Dan Quinn avatar  avatar Steve Moreno avatar Roger Carter avatar Rene Gutierrez avatar Stuble avatar Jason Kaye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.