Download the PHP package bugsnag/bugsnag-psr-logger without Composer
On this page you can find all versions of the php package bugsnag/bugsnag-psr-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bugsnag/bugsnag-psr-logger
More information about bugsnag/bugsnag-psr-logger
Files in bugsnag/bugsnag-psr-logger
Package bugsnag-psr-logger
Short Description Official Bugsnag PHP PSR Logger.
License MIT
Homepage https://github.com/bugsnag/bugsnag-psr
Informations about the package bugsnag-psr-logger
Bugsnag PHP PSR Logger
The Bugsnag PHP PSR logger is an implementation of the Fig PSR logging standard that provides a standard interface to logging to Bugsnag.
Getting Started
Installing
Add bugsnag/bugsnag-psr-logger
to your composer.json
.
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.
Using the Loggers
The library provides two loggers, BugsnagLogger
and MultiLogger
.
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.
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.
The default level at which logs will be sent to Bugsnag is Psr\Log\LogLevel::NOTICE
. This can be overridden using the setNotifyLevel
function:
For more information on integrating the loggers into specific frameworks see the individual setup information found in the bugsnag-php documentation.
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.
License
The Bugsnag PSR logger is free software released under the MIT License. See LICENSE.txt for details.