New logging architecture implemented.

Still problems with it though.