Redo logging so that it's categorised, neat, timestamped and configurable.