Optimizing logging output