Documentation 2.x and 3.x

We have moved! This is an old documentation which is no longer officially supported.
Check out our new v4.0 documentation.

System log

Default way to log important events of your plugin

ImpressPages CMS has a default logging system. All logs are visible in Administrator -> Log tab.

Old logs are automatically removed. You can adjust for how long logs should be stored by changing administrator/log/parameters/log_size_in_days parameter.

Log your own values

<?php 
$log = \Ip\ServiceLocator::getLog();
$log->log('yourPluginGroup/yourPluginName', 'Any value, for example, a text of an error');
?>

If you like you can add additional string / integer / float data to the log entry:

<?php 
$log = \Ip\ServiceLocator::getLog();
$errorStringValue = 'detailed error description / message';
$errorIntegerValue = 1;
$errorFloatValue = 0.5;
$log->log('yourPluginGroup/yourPluginName', 'Any name of error', $errorStringValue, $errorIntegerValue, $errorFloatValue);

?>

Write a comment

You must be logged in to comment.