PHP Client for Amon
PHP
Latest commit ea2fe82 Apr 3, 2013 Martin Rusev Update README.md
Permalink
Failed to load latest commit information.
amon ZeroMQ speed improvements Apr 26, 2012
example Secret key Aug 9, 2012
README.md Update README.md Apr 3, 2013
amon.php Secret key Aug 9, 2012
benchmark.php Disable http benchmarks by default Apr 27, 2012

README.md

Install

Download the client from https://github.com/martinrusev/amon-php

Configuration

require_once 'amon.php'
Amon::config(array('host'=> 'http://127.0.0.1', 'port' => 2464, 
'secret_key': 'the secret key from /etc/amonlite.conf'));

Usage

Logging

You can use the logging module in any PHP application:

# message - array, string
Amon::log(message, tags);

# Will still work and in the web interface you will see these logs with level 'unset'
Amon::log(message);

# Tagged logging
Amon::log(message, array('debug', 'info'));

Exception handling

To capture exceptions triggered from your PHP applications, add the following 2 lines in your index.php file

require "amon.php";
Amon::setup_exception_handler();