/**
* Logs calls of destroy()
*
* @Flow\Before("within(Neos\Flow\Session\SessionInterface) && method(.*->destroy())")
* @param JoinPointInterface $joinPoint The current joinpoint
* @return mixed The result of the target method if it has not been intercepted
*/
public function logDestroy(JoinPointInterface $joinPoint)
{
$session = $joinPoint->getProxy();
if ($session->isStarted()) {
$reason = $joinPoint->isMethodArgument('reason') ? $joinPoint->getMethodArgument('reason') : 'no reason given';
$this->systemLogger->log(sprintf('%s: Destroyed session with id %s: %s', $this->getClassName($joinPoint), $joinPoint->getProxy()->getId(), $reason), LOG_INFO);
}
}