adding conditional logging around Message#publish method