Skip to content

Instantly share code, notes, and snippets.

@krismas
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krismas/c321a4b3e29675424526 to your computer and use it in GitHub Desktop.
Save krismas/c321a4b3e29675424526 to your computer and use it in GitHub Desktop.
A small MODX Snippet / Output Filter to log message to the MODX error log
<?php
/**
* log : A small MODX Snippet / Output Filter to log message to the MODX error log
*
* @version : 1.0.0
* @see : https://gist.github.com/krismas/c321a4b3e29675424526
* @name : log.php
* @author : g.noel@ackwa.fr
* @usage : [[*aTV:log]]
* [[+aPH:log]]
* [[log?msg=`A message...`]]
*
* @history : 19/08/14 - 1.0.0 - Initial revision
*/
$msg = ($input ? $input : $modx->getOption('msg', $scriptProperties,'Empty message!'));
$modx->log(modX::LOG_LEVEL_ERROR, '[#'.$modx->resource->get('id').'] '.$msg);
return '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment