Coder Social home page Coder Social logo

bugsnag-agent's Introduction

The Bugsnag agent forwards reports from your server to bugsnag.com or an on-premise Bugsnag installation. It's used to avoid any latency impact that might occur if you need to make a call over the network in every exception handler.

Getting started

First you need to download the bugsnag-agent from here and make it executable on your server. For example:

curl -L http://git.io/q2AUSA | sudo tee /usr/bin/bugsnag-agent
sudo chmod +x /usr/bin/bugsnag-agent

Next you need to run it.

$ bugsnag-agent
Bugsnag Agent started. http://127.0.0.1:3829 -> https://notify.bugsnag.com/

You can verify that it's running using curl in another terminal:

$ curl http://127.0.0.1:3829
Bugsnag agent: 127.0.0.1:3829 -> https://notify.bugsnag.com/ (0/1000)%

Finally you need to configure the endpoint of your Bugsnag apps to be http://localhost:3829. This differs per notifier, but for example PHP is:

$bugsnag->setEndpoint("localhost:3829");
$bugsnag->setUseSSL(false);

Upstart

If you'd like to ensure Bugsnag is always running, you can save the following upstart script as /etc/init/bugsnag.conf and then run sudo start bugsnag.

#!upstart
description "Bugsnag forwarding agent"
author      "Bugsnag <[email protected]>"

start on (filesystem and net-device-up IFACE=lo)
stop on shutdown

respawn
respawn limit 99 5

console log

script
    exec bugsnag-agent
end script

Configuration

bugsnag-agent reads /etc/bugsnag.conf if it exists. The default configuration is:

# Default configuration for bugsnag.
[bugsnag]

# The port to listen on.
port = 3829

# The interfact to listen on. Set this to 0.0.0.0 if you want to allow anyone
# to forward to Bugsnag. If you do that, ensure that this process is firewalled
# off from the global internet.
listen = 127.0.0.1

# The endpoint to send exceptions to. This can be another `bugsnag-agent`,
# https://notify.bugsnag.com/ or your local on-premise Bugsnag.
endpoint = https://notify.bugsnag.com/

You can change which configuration file is used with the -c parameter:

bugsnag-agent -c /usr/local/etc/bugsnag.conf

All the options can also be set directly using command line flags:

bugsnag-agent --port 3829 --listen 127.0.0.1 --endpoint https://notify.bugsnag.com/

Meta

bugsnag-agent is copyright under the MIT license. See LICENSE.MIT for details.

Bug reports and pull requests are welcome.

bugsnag-agent's People

Contributors

conradirwin avatar jesseschalken avatar jmshal avatar keeganlow avatar

Watchers

 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.