Download the PHP package pluggit/logging without Composer
On this page you can find all versions of the php package pluggit/logging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pluggit/logging
More information about pluggit/logging
Files in pluggit/logging
Package logging
Short Description Logging provides a thin PSR-7 interface abstraction to connect any logging facility behind it.
License MIT
Informations about the package logging
Pluggit Logging
Logging gives you a simple abstraction compatible with PSR-3 logger interface that you can connect to a different backend to customize your logging needs
Logging provides a thin PSR-7 interface abstraction to connect any logging facility behind it.
Installation
Require the library as usual:
Monolog
This library provides Monolog as its main logging backend. You will need to install the library manually:
To create factory, set default channel name as first parameter and Formatter as second one.
Handlers
The library provides a factory to ease the addition of some handlers to the logger objects,
Built in handlers
-
RotatingFileHandler
This handler will write the log messages to a file, rotating the name depending on the given date format - SyslogUdpHandler
This handler will send a UDP packet with the log message, useful to send messages to 3rd party log platforms or storage servers (like ElasticSearch)
Adding custom handler
To add custom handler you should write handler builder implementing HandlerBuilderInterface:
The handler builder should be added using addHandlerBuilder method:
Error handler
To add default error handler use addErrorHandlerBuilder method.