Download the PHP package yeebase/graylog without Composer
On this page you can find all versions of the php package yeebase/graylog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yeebase/graylog
More information about yeebase/graylog
Files in yeebase/graylog
Package graylog
Short Description Graylog exception handler for Neos Flow
License MIT
Informations about the package graylog
Yeebase.Graylog
The Yeebase.Graylog Flow package logs your exceptions as well as single messages to a central Graylog server. This package also provides a simple backend to log message of Flows Logger classes to a Graylog server.
It depends on the official GELF php package https://github.com/bzikarsky/gelf-php
Installation & configuration
Just add "yeebase/graylog" as dependency to your composer.json and run a "composer update" in your project's root folder or simply execute:
from your project's root.
Configure your Graylog Server:
Logging backend
To configure GraylogBackend as the default logging backend, put this in your Settings.yaml:
Log exceptions
Activate the exception handler and configure the connection to your graylog server in your Settings.yaml:
Now all Exceptions that are shown to the Web or CLI are logged to graylog.
Note: For Development
context, the Neos.Flow
package overrides this setting. Make sure to add this configuration
in the right context Settings.yaml.
If you want to log additionally all Exceptions to graylog you should replace the systemLogger as well. This will log all errors that are logged with the SystemLogger to Graylog as well to the disk. By default Flow will only log a single line to the system log aka "See also ... .txt". The GraylogLogger will also log the full Exception.
Filter exceptions
To skip certain exceptions from being logged you can either use the skipStatusCodes
setting:
Since version 2.1 you can alternatively use the renderingGroups
Flow setting, i.e. to exclude certain Exception
classes from being logged:
Manual logging
If you wish to log normal log messages to your Graylog server just use the provided GraylogLoggerInterface
:
By default messages will also be logged to the SystemLoggerInterface
when Flow runs in Development
context. You
can enable or disable this function with a setting:
Extend the message context
By default this package will send a bunch of values to graylog you can use to filter on. A Exception for instance has
some fields like reference_code
, response_status_code
and so on.
You can extend those values via Settings.yaml. Just pass an array of values to Yeebase.Graylog.messageContext
.
This is useful to pass some static values to your logs to filter on in Graylog.