rewrite of agent and addition of logsink
tweak logsink