Previously used message logging logic. Not used anymore