log: make tags safe for str comparison up to maximum logfile size