diff --git a/src/app/Services/RabbitMQLogService.php b/src/app/Services/RabbitMQLogService.php new file mode 100644 index 0000000..a2c7a69 --- /dev/null +++ b/src/app/Services/RabbitMQLogService.php @@ -0,0 +1,37 @@ + $caller, + 'status_code' => $exception->getCode(), + 'line' => $exception->getLine(), + 'file' => $exception->getFile(), + 'error_code' => $contextDto->code, + 'custom_data' => $this->asPrettyJson($contextDto->custom_data), + 'tags' => $contextDto->tags, + 'exception' => get_class($exception), + 'current_url' => $contextDto->current_url, + 'current_user' => $this->asPrettyJson($contextDto->current_user), + 'classes' => $this->asPrettyJson($this->getContextClasses($exception->getTrace(), $contextDto->root_namespace)), + ]; + } +} \ No newline at end of file diff --git a/src/app/Traits/LogTrait.php b/src/app/Traits/LogTrait.php index c0b79d5..b449252 100644 --- a/src/app/Traits/LogTrait.php +++ b/src/app/Traits/LogTrait.php @@ -10,6 +10,7 @@ use Ae3\LaravelLogsLayer\app\Services\DailyLogService; use Ae3\LaravelLogsLayer\app\Services\DiscordLogService; use Ae3\LaravelLogsLayer\app\Services\EmailLogService; use Ae3\LaravelLogsLayer\app\Services\LogstashLogService; +use Ae3\LaravelLogsLayer\app\Services\RabbitMQLogService; use Hashids\Hashids; use Illuminate\Support\Str; use Throwable; @@ -52,6 +53,10 @@ trait LogTrait if ($defaultChannel === 'email' || in_array('email', $stackChannels, true)) { $this->logServices[] = app(EmailLogService::class); } + + if ($defaultChannel === 'rabbitmq' || in_array('rabbitmq', $stackChannels, true)) { + $this->logServices[] = app(RabbitMQLogService::class); + } } /**