clog-client-php is a PHP client for the Clog logging platform.
Tags can be defined at the message or at the logger level for additional flexibility.
See the file example/basic_example.php
for a simple introduction.
<?php
require_once('lib/ClogLogger.php');
$logger = new \Clog\ClogLogger(array(
'host' => 'clog.your-site.com',
'port' => '443',
'protocol' => 'https',
'token' => 'XXXXXXXXX',
'project_id' => 'XXXXXXXXX'
));
See clog documentation to get your token. The project_id is the name of your project.
Without tags :
$logger->log("This is a log message");
With tags attached :
$logger->log("This is another log message", array(
'log-message-tag-1' => 'log message tag value 1',
'other-message-tag' => 'other value'
));
Tags attached to the log message override tags set at the logger level, and tags set at the project level (see clog documentation).
$logger->setTags(array("logger-tag-1" => "logger value 1", "logger-tag-2" => "logger_value_2"));
$logger->setTag("logger-tag-3", "logger value 3");
Any subsequent log message sent to that logger will have those tags by default.
Tags set at the logger level override tags set at the project level, but can be overriden by tags associated with the individual messages.
The ClogCore.class.php
is a minor adaptation (aka: a rip-off) of IronCore.class.php
which can be found here. The guys from Iron.io deserve all the kudos for creating this neat little lib. If you happen to be one of them : THANK YOU.
This software is released under the BSD 2-Clause License. You can find the full text of this license under LICENSE.txt in the module's root directory.