mivita/app/Services/MyLog.php
Kevin 316a9b76d6 Pint: Formatierung des bisherigen Stands, ohne inhaltliche Aenderung
Die Dateien lagen im Arbeitsbaum formatiert und inhaltlich geaendert
zusammen. Dieser Commit enthaelt nur die Pint-Formatierung des alten
Stands, damit die folgenden Commits nur noch Inhalt zeigen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 15:39:17 +00:00

31 lines
944 B
PHP

<?php
namespace App\Services;
use App\Mail\MailLog;
use Illuminate\Support\Facades\Mail;
class MyLog
{
public static function writeLog($channel = 'payment', $context = 'error', $message = '', $data = [], $mail = true)
{
switch ($context) {
case 'notice':
\Log::channel($channel)->notice($message.' : '.json_encode($data));
break;
case 'warning':
\Log::channel($channel)->warning($message.' : '.json_encode($data));
break;
case 'info':
\Log::channel($channel)->info($message.' : '.json_encode($data));
break;
default:
\Log::channel($channel)->error($message.' : '.json_encode($data));
break;
}
if ($mail) {
Mail::to(config('app.exception_mail'))->send(new MailLog($channel, $context, $message, $data));
}
}
}