phptek\Sentry\SentryLogWriter
The SentryLogWriter class simply acts as a bridge between the configured Sentry adaptor and SilverStripe's {@link SS_Log}.
Usage in your project's _config.php for example (See README for examples).
SS_Log::add_writer(\phptek\Sentry\SentryLogWriter::factory(), '<=');
Synopsis
class SentryLogWriter
extends Zend_Log_Writer_Abstract
{
- // constants
- const SLW_NOOP = 'Unavailable';
- // methods
- public static SentryLogWriter factory()
- public SentryClientAdaptor getClient()
- public string defaultEnv()
- public array defaultUserData()
- public array defaultTags()
- public array defaultExtra()
- protected void _write()
- public string getPackageInfo()
- public string getIP()
- public string getRequestType()
- public float getPeakMemory()
- public string getUserAgent()
- public string getReqMethod()
- public string getSAPI()
Hierarchy
Extends
- Zend_Log_Writer_Abstract
Constants
Name | Value |
---|---|
SLW_NOOP | 'Unavailable' |
Methods
protected
- _write() — _write() forms the entry point into the physical sending of the error. The sending itself is done by the current adaptor's `send()` method.
public
- defaultEnv() — Returns a default environment when one isn't passed to the factory() method.
- defaultExtra() — Returns a default set of extra data to show upon selecting a message for analysis in the Sentry UI. This can augment the data sent to Sentry at setup time in _config.php as well as at runtime when calling SS_Log itself.
- defaultTags() — Returns a default set of additional "tags" we wish to send to Sentry.
- defaultUserData() — Returns a default set of additional data specific to the user's part in the request.
- factory() — A static constructor as per {@link Zend_Log_FactoryInterface}.
- getClient() — Used in unit tests.
- getIP() — Return the IP address of the relevant request.
- getPackageInfo() — Return the version of $pkg taken from composer.lock.
- getPeakMemory() — Return peak memory usage.
- getReqMethod() — Basic reuqest method check and return.
- getRequestType() — What sort of request is this? (A harder question to answer than you might think: http://stackoverflow.com/questions/6275363/what-is-the-correct-terminology-for-a-non-ajax-request)
- getSAPI()
- getUserAgent() — Basic User-Agent check and return.