Add log filtering to prevent sensitive data leakage

This commit is contained in:
crazywhalecc
2026-03-05 08:17:41 +08:00
parent f7277cc012
commit 715f33ac4d
5 changed files with 43 additions and 15 deletions

View File

@@ -52,7 +52,7 @@ if (filter_var(getenv('SPC_ENABLE_LOG_FILE'), FILTER_VALIDATE_BOOLEAN)) {
$log_file_fd = fopen(SPC_OUTPUT_LOG, 'a');
$ob_logger->addLogCallback(function ($level, $output) use ($log_file_fd) {
if ($log_file_fd) {
fwrite($log_file_fd, strip_ansi_colors($output) . "\n");
spc_write_log($log_file_fd, strip_ansi_colors($output) . "\n");
}
return true;
});