We want to improve our logging practices in a web app, but we are cautious about exposing personally identifiable information (PII). How can we securely log user-related metadata (e.g., usernames, IP addresses, and device information) without risking PII exposure? Is there a way to anonymize or mask this data effectively while ensuring it’s still useful for detecting suspicious activities?