mail send debug
This commit is contained in:
@@ -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
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user