LPS-39259 Optimize log sanitizer

ccing @rotty3000