This will put a message about the event in the Manager Actions log:
$modx->logManagerAction(string $action, string $class_key, mixed $item) — Log an event to the Manager Action log. $action is the lexicon key of the event (e.g., ’chunk_create’, ’resource_update’). $class_key is the class key of the object the action is performed on (e.g., ’modChunk’, ’modResource’). $item is the ID or array of IDs for the object(s) being acted on (e.g., $resource->get(’id’)).
Here’s an example from the ActivationEmail plugin:
$modx->logManagerAction($eventName,'modUser',$user->get('id'));
You can then view the actions in Reports -> Manager Actions. The report can be filtered by user, action, and/or date, but there’s no way at present to download it (nice feature request though).
You could also write whatever you want to a file with $modx->log() after using setLogTarget() to point to your file (don’t forget to set it back after logging the info). I think that’s what I would do. Something like this:
<?php
$oldTarget = $modx->setLogTarget('FILE');
$target = array(
'target' => 'FILE',
'options' => array(
'filename' => 'path_to_file'),
);
$msg = 'Joe Blow saved a file at ' . time();
$modx->log(xPDO::LOG_LEVEL_INFO, $msg, $target);
$modx->setLogTarget($oldTarget);