Logging now works

Apart from actual encryption, it is good to go.