Download the PHP package noerdisch/elasticlog without Composer
On this page you can find all versions of the php package noerdisch/elasticlog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download noerdisch/elasticlog
More information about noerdisch/elasticlog
Files in noerdisch/elasticlog
Package elasticlog
Short Description Logger Backend that uses elasticsearch for Neos Flow
License MIT
Homepage https://www.noerdisch.com
Informations about the package elasticlog
Nœrdisch ElasticLog
The Noerdisch.ElasticLog Flow package logs exceptions and single messages to a configured elastic search server. This package also provides a backend to log message of Flows Logger classes to a elastic search server.
Installation & configuration
Just add "noerdisch/elasticlog" 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 Elastic Server:
We provide a command controller to setup you elastic search index. You can use it to create the index or to reset the logger.
Manual logging
If you wish to log normal log messages to your elastic server just use the provided ElasticLoggerInterface
:
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:
Logging backend
To configure ElasticBackend as the default logging backend, put this in your Settings.yaml:
Log exceptions
Activate the exception handler and configure the connection to your elastic search server in your Settings.yaml:
Now all Exceptions that are shown to the Web or CLI are logged to elastic.
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 elastic search you should replace the systemLogger as well. This will log all errors that are logged with the SystemLogger to ElasticLog as well to the disk. By default Flow will only log a single line to the system log aka "See also ... .txt". The ElasticLogger will also log the full Exception.
Filter exceptions
To skip certain exceptions from being logged you can either use the skipStatusCodes
setting:
Thanks
The package was build on the Graylog package from Yeebase. Thanks to the nice people from Yeebase for sharing it. Checkout their repositories on github. They also ❤️ Neos and the Neos flow framework.
We are not using Graylog since we wanted to make use of the whole ELK stack elastic is offering