Log sink implementation. Fixes #351

when you have a system crash all bets are off. when you close a file it does not guarantee that the file is flushed, either.