2017 © Pedro Peláez
 

library bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

image

bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

  • Thursday, May 10, 2018
  • by graham-campbell
  • Repository
  • 12 Watchers
  • 75 Stars
  • 1,724,281 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 15 Versions
  • 14 % Grown

The README.md

Bugsnag PHP PSR Logger

StyleCI Status, (*1)

The Bugsnag PHP PSR logger is an implementation of the Fig PSR logging standard that provides a standard interface to logging to Bugsnag., (*2)

Getting Started

Installing

Add bugsnag/bugsnag-psr-logger to your composer.json., (*3)

Configuring

This library provides a logger interface but uses the bugsnag-php notifier library as a base. All configuration should be performed as described in the official bugsnag-php documentation., (*4)

Using the Loggers

The library provides two loggers, BugsnagLogger and MultiLogger., (*5)

BugsnagLogger will automatically send a notification to Bugsnag if it receives a message with a severity higher than info. This will allow you to notify of any handled exceptions through interfacing the logger directly with the framework you are using. Ensure that the logger can communicate with the bugsnag-php library by passing the client object into it on creation., (*6)

$bugsnag = Bugsnag\Client::make('YOUR-API-KEY-HERE');
$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);

# Will send a notification to bugsnag
$logger->error('An error occurred');

If you wish to use a separate logger alongside BugsnagLogger you will need to use MultiLogger. By passing it an array of Logger objects on construction, MultiLogger will call into each passed Logger in turn when a message is logged., (*7)

$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);
$mySecondLogger = new Logger();
$multiLogger = new Bugsnag\PsrLogger\MultiLogger([$logger, $mySecondLogger]);

# Will log to $mySecondLogger and send a notification to bugsnag through $logger
$multiLogger->error('An error occurred');

The default level at which logs will be sent to Bugsnag is Psr\Log\LogLevel::NOTICE. This can be overridden using the setNotifyLevel function:, (*8)

$logger = new Bugsnag\PsrLogger\BugsnagLogger($bugsnag);

# Will not send a notification to bugsnag by default
$logger->info('Some interesting information');

$logger->setNotifyLevel(Psr\Log\LogLevel::INFO);

# Will send a notification to bugsnag
$logger->info('Some more interesting information');

For more information on integrating the loggers into specific frameworks see the individual setup information found in the bugsnag-php documentation., (*9)

Contributing

All contributors are welcome! For information on how to build, test and release bugsnag-psr-logger, see our contributing guide. Feel free to comment on existing issues for clarification or starting points., (*10)

License

The Bugsnag PSR logger is free software released under the MIT License. See LICENSE.txt for details., (*11)

The Versions

10/05 2018

dev-master

9999999-dev https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

16/02 2018

v1.4.1

1.4.1.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

21/12 2017

v1.4.0

1.4.0.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

19/12 2017

dev-warning-fix

dev-warning-fix https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

14/12 2017

v1.3.0

1.3.0.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

24/11 2017

dev-logLevel

dev-logLevel https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

15/11 2017

dev-kattrali/simplify-tests

dev-kattrali/simplify-tests https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

16/10 2017

dev-update-readme

dev-update-readme https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

06/10 2017

v1.2.1

1.2.1.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

02/10 2017

v1.2.0

1.2.0.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

23/09 2017

dev-handled-unhandled

dev-handled-unhandled https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

22/09 2017

v1.1.1

1.1.1.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

09/08 2016

v1.1.0

1.1.0.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

08/07 2016

v1.0.1

1.0.1.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag

07/07 2016

v1.0.0

1.0.0.0 https://github.com/bugsnag/bugsnag-psr

Official Bugsnag PHP PSR Logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr logging errors tracking exceptions bugsnag