This commit is contained in:
2026-03-10 19:38:13 +09:00
parent 9650707caf
commit 141f526f91
3 changed files with 30 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ if (! function_exists('write_custom_log')) {
*/
function write_custom_log($message, $level = 'INFO', $type = 'service')
{
$logDir = WRITEPATH . 'logs/worker';
$logDir = WRITEPATH . 'logs';
if (!is_dir($logDir)) {
@mkdir($logDir, 0777, true);
}
@@ -31,8 +31,8 @@ if (! function_exists('write_custom_log')) {
}
// ----------------------------
$suffix = ($type === 'failed') ? '_failed' : '';
$logFile = $logDir . '/' . date('Y-m-d') . $suffix . '.log';
$suffix = ($type === 'failed') ? '-failed' : '';
$logFile = $logDir . '/log-' . date('Y-m-d') . $suffix . '.log';
$timestamp = date('Y-m-d H:i:s');
$singleLine = str_replace(["\r", "\n", "\t"], " ", $message);