=== How does this work?

Data being used for logging should be content restricted, typed, and sanitized. +
Sanitization mainly revolves around stripping carriage return (CR) and line feed (LF) characters, but further actions could be required based on the application context and the logged data usage.