Log sink implementation. Fixes #351