Maybe I haven’t understood the purpose of that lib

I thought it could be a useful helper when writing plugins/snippets etc. to create a kind of "console" or log.
So, in a plugin, listening to "OnDocPublished" and "OnDocUnPublished", I tried to use it like that:
require_once('assets/libs/docapi/docmanager.class.inc.php');
global $content;
$e = &$modx->Event;
$logpage = new Document();
$logpage->Set('content', 'logging started');
$log = $logpage->Get('content');
$uid = $modx->getLoginUserID();
switch($e->name)
{
case 'OnDocPublished':
$uid = $modx->getLoginUserID();
$log .= "a document was published by ".$uid;
$logpage->Set('content',$log); $logpage->Save();
break;
case 'OnDocUnPublished':
$uid = $modx->getLoginUserID();
$log .= "a document was unpublished by ".$uid;
$logpage->Set('content',$log); $logpage->Save();
break;
case 'OnManagerLogin':
$log .= "manager logged in.";
$logpage->Set('content',$log); $logpage->Save();
break;
default:
$log .= "nothing happened at all";
$logpage->Set('content',$log); $logpage->Save();
return;
break;
}
But, it doesn’t work. I know, my Plugin is executing, but it is not creating a "logging"-doc.
(I tried it initially with an existing doc and called it like $logpage = new Document(54)
- 54 was the id of the doc to store the log in - didn’t work either.)
Seems I’m on the wrong fork here? But if it’s not for automated doc-manipulation from the backend I really have no clue how it can be used anyway...