mail send debug

This commit is contained in:
2026-08-08 23:17:53 +03:00
parent 28fc484c9f
commit 1ae5a444cf
+18
View File
@@ -0,0 +1,18 @@
<?php
// TEMPORARY
/** Appends one timestamped line. Silent if the file cannot be written. */
function debug_log(string $message): void
{
$path = dirname(__DIR__, 3) . '/storage/logs/casadoc-api.log';
$dir = dirname($path);
if (!is_dir($dir) && !@mkdir($dir, 0775, true) && !is_dir($dir)) {
return;
}
@file_put_contents(
$path,
'[' . date('Y-m-d H:i:s') . '] ' . rtrim($message) . "\n",
FILE_APPEND | LOCK_EX
);
}