/usr/share/php/Analog/Handler/Amon.php is in php-analog 1.0.7-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | <?php
namespace Analog\Handler;
/**
* Send the log message to an Amon monitoring server (http://amon.cx/).
*
* Usage:
*
* // First include the Amon classes
* require 'amon.php';
*
* // Initialize the Analog Amon handler
* Analog::handler (Analog\Handler\Amon::init (
* 'http://127.0.0.1', // server address
* 2464, // port number
* 'abc123def456' // application key
* ));
*/
class Amon {
public static function init ($host = 'http://127.0.0.1', $port = 2464, $key = false) {
\Amon::config (array (
'host' => $host,
'port' => $port,
'application_key' => $key
));
$tags = array (
0 => 'urgent',
1 => 'alert',
2 => 'critical',
3 => 'error',
4 => 'warning',
5 => 'notice',
6 => 'info',
7 => 'debug'
);
return function ($info) use ($tags) {
\Amon::log ($info, array ($tags[$info['level']]));
};
}
}
|