psr2 tidy up of logging code.