diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a00ad7e..b38e55d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,33 @@ # Changelog -## Next release +## 0.18.2 + +- removed type hinting from RollbarException + +## 0.18.1 + +- added configuration switch for disabling utf 8 sanitization + +## 0.18.0 + +- Added support for checkIgnore function See [#82](https://github.com/rollbar/rollbar-php/pull/82) + +## 0.17.0 + +- Accidental tag of documentation change. No API change present. + +## 0.16.0 + +Features: + +- Added support for reporting errors in Command Line Scripts. +- Added (opt-in) support for capturing line of code and context around that code in stack traces. See [#76](https://github.com/rollbar/rollbar-php/pull/76) +- Added Level class with string constants for Level values. Bug fixes: - Fixed the severity level that E_PARSE errors are reproted at. See [#75](https://github.com/rollbar/rollbar-php/pull/75) +- Captured \Throwable rather than \Exception if using PHP 7 ## 0.15.0 diff --git a/README.md b/README.md index 6ec57b5b..3b433e2b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,36 @@ +--- +layout: page +sidebar: rollbar_sidebar +permalink: /notifiers/rollbar-php/ +toc: false +--- # Rollbar notifier for PHP [![Build Status](https://travis-ci.org/rollbar/rollbar-php.png?branch=v0.15.0)](https://travis-ci.org/rollbar/rollbar-php) This library detects errors and exceptions in your application and reports them to [Rollbar](https://rollbar.com) for alerts, reporting, and analysis. - + + +##Table of Contents + +- [Quick start](#quick-start) +- [Installation](#installation) + - [General](#general) + - [If Using Composer](#if-using-composer) +- [Setup](#setup) + - [For Heroku Users](#for-heroku-users) +- [Basic Usage](#basic-usage) +- [Batching](#batching) +- [Using Monolog](#using-monolog) +- [Configuration](#configuration) + - [Asynchronous Reporting](#asynchronous-reporting) + - [Configuration reference](#configuration-reference) +- [Related projects](#related-projects) +- [Help / Support](#help--support) +- [Contributing](#contributing) + + ## Quick start @@ -41,7 +67,8 @@ throw new Exception('test 2'); ### General -Download [rollbar.php](https://raw.github.com/rollbar/rollbar-php/master/src/rollbar.php) and put it somewhere you can access. +Download [rollbar.php](https://raw.github.com/rollbar/rollbar-php/master/src/rollbar.php) and [Level.php](https://raw.githubusercontent.com/rollbar/rollbar-php/master/src/Level.php) +and put them together somewhere you can access. ### If Using Composer @@ -50,7 +77,7 @@ Add `rollbar/rollbar` to your `composer.json`: ```json { "require": { - "rollbar/rollbar": "~0.15.0" + "rollbar/rollbar": "~0.18.0" } } ``` @@ -147,6 +174,28 @@ For example, if using Laravel, add the above line to your `App::after()` event h You can also tune the max batch size or disable batching altogether. See the `batch_size` and `batched` config variables, documented below. +## Using Monolog + +Here is an example of how to use Rollbar as a handler for Monolog: + +``` +use Monolog\Logger; +use Monolog\Handler\RollbarHandler; + +$config = array('access_token' => 'POST_SERVER_ITEM_ACCESS_TOKEN'); + +// installs global error and exception handlers +Rollbar::init($config); + +$log = new Logger('test'); +$log->pushHandler(new RollbarHandler(Rollbar::$instance)); + +try { + throw new Exception('exception for monolog'); +} catch (Exception $e) { + $log->error($e); +} +``` ## Configuration @@ -211,11 +260,44 @@ Default: `master` Default: `true` +