23-01-2026

This commit is contained in:
Kevin Adametz 2026-01-23 17:35:23 +01:00
parent a67740d6ef
commit 7325edebbd
245 changed files with 29211 additions and 4796 deletions

View file

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