Log sink implementation. Fixes #351

I suggest you keep the file open and just write to it instead of opening the file at every log write.