Download the PHP package crxgames/monolog-pomm without Composer
On this page you can find all versions of the php package crxgames/monolog-pomm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crxgames/monolog-pomm
More information about crxgames/monolog-pomm
Files in crxgames/monolog-pomm
Package monolog-pomm
Short Description A handler for Monolog that sends messages to Postgres via a POMM connection
License MIT
Homepage https://github.com/crxgames/monolog-pomm
Informations about the package monolog-pomm
monolog-pomm
PostgreSQL Handler for Monolog utilizing the POMM library (http://www.pomm-project.org/), which allows to store log messages in a Postgres Table. It can log text messages to a specific table, and creates the table automatically if it does not exist.
Based on https://github.com/wiosna-dev/monolog-pg
Installation
monolog-pomm is available via composer. Just add the following line to your required section in composer.json and do a php composer.phar update
.
Usage
Just use it as any other Monolog Handler, push it to the stack of your Monolog Logger instance. The Handler however needs some parameters:
- $pomm POMM Session instance of your database. Pass along the POMM instantiation of your database connection with your database selected.
- $table The table name where the logs should be stored
- $level can be any of the standard Monolog logging levels. Use Monologs statically defined contexts. Defaults to Logger::DEBUG
- $bubble Defaults to true
Examples
Given that $pomm is your database session instance, you could use the class as follows:
License
This tool is free software and is distributed under the MIT license. Please have a look at the LICENSE file for further information.