2017 © Pedro Peláez
 

library monolog-pomm

A handler for Monolog that sends messages to Postgres via a POMM connection

image

crxgames/monolog-pomm

A handler for Monolog that sends messages to Postgres via a POMM connection

  • Monday, May 16, 2016
  • by crxgames
  • Repository
  • 1 Watchers
  • 2 Stars
  • 233 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 82 % Grown

The README.md

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., (*1)

Based on https://github.com/wiosna-dev/monolog-pg, (*2)

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., (*3)

"crxgames/monolog-pomm": ">1.0.0"

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:, (*4)

  • $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:, (*5)

//Import class
use PommPGHandler\PommPGHandler;

//Create MysqlHandler
$pommHandler = new PommPGHandler($pomm, "log");

//Create logger
$logger = new \Monolog\Logger($context);
$logger->pushHandler($mySQLHandler);

//Now you can use the logger, and further attach additional information
$logger->addWarning("This is a great message, woohoo!", array('username'  => 'John Doe', 'userid'  => 245));

License

This tool is free software and is distributed under the MIT license. Please have a look at the LICENSE file for further information., (*6)

The Versions

16/05 2016

dev-master

9999999-dev https://github.com/crxgames/monolog-pomm

A handler for Monolog that sends messages to Postgres via a POMM connection

  Sources   Download

MIT

The Requires

 

by Cody Mays

database log postgresql logging monolog pomm

16/05 2016

1.0.0

1.0.0.0 https://github.com/crxgames/monolog-pomm

A handler for Monolog that sends messages to Postgres via a POMM connection

  Sources   Download

MIT

The Requires

 

by Cody Mays

database log postgresql logging monolog pomm