Which log level should be used when logging sensitive information such as user passwords or personal identification numbers in a production environment?
Trap 1: Trace
Trace logs capture highly granular details often used during local debugging. While this level records much data, it is not an excuse to log sensitive information. Security best practices mandate that passwords and PII must never be stored in plain text within log files regardless of the chosen severity level.
Trap 2: Verbose
Verbose logging provides extensive diagnostic data about variable states and activity flow. While useful for complex troubleshooting, it remains subject to strict security policies. Sensitive data must be excluded from all logs, as verbose logging is frequently forwarded to centralized systems where unauthorized personnel might gain access to logs.
Trap 3: Error
Error logs capture events that prevent the automation from proceeding normally. Even during an error, developers must ensure that data dumped to the log file does not contain plain-text credentials or sensitive user data. Logging sensitive information at an error level is still a critical security vulnerability that requires mitigation.
- A
Trace
Why it fails: Trace logs capture highly granular details often used during local debugging. While this level records much data, it is not an excuse to log sensitive information. Security best practices mandate that passwords and PII must never be stored in plain text within log files regardless of the chosen severity level.
- B
Verbose
Why it fails: Verbose logging provides extensive diagnostic data about variable states and activity flow. While useful for complex troubleshooting, it remains subject to strict security policies. Sensitive data must be excluded from all logs, as verbose logging is frequently forwarded to centralized systems where unauthorized personnel might gain access to logs.
- C
None of the above
No log level is appropriate for logging sensitive information. Security standards explicitly prohibit exposing passwords or PII in logs, as these files are often accessible to support teams and monitoring systems. Developers must implement data masking or use secure credential stores to handle sensitive data without writing it to disk.
- D
Error
Why it fails: Error logs capture events that prevent the automation from proceeding normally. Even during an error, developers must ensure that data dumped to the log file does not contain plain-text credentials or sensitive user data. Logging sensitive information at an error level is still a critical security vulnerability that requires mitigation.