diff --git a/app/Classes/General/Abstracts/AbstractControllerLogic.php b/app/Classes/General/Abstracts/AbstractControllerLogic.php index f523ed3c..adb16f81 100644 --- a/app/Classes/General/Abstracts/AbstractControllerLogic.php +++ b/app/Classes/General/Abstracts/AbstractControllerLogic.php @@ -16,6 +16,7 @@ use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\ResourceCollection; use Illuminate\Support\Facades\DB; use App\Classes\Exceptions\JobResourceNotFoundException; +use App\Classes\General\LogHelper; use Illuminate\Support\Facades\Log; abstract class AbstractControllerLogic @@ -65,7 +66,7 @@ abstract class AbstractControllerLogic } catch (ErrorException|GeneralExceptions|TypeError $exception){ if ($exception instanceof JobResourceNotFoundException) { - Log::channel('vue_polling')->info(sprintf( + LogHelper::channel('vue_polling')->info(sprintf( "Uncaught exception '%s' with message '%s' in %s:%d", get_class($exception), $exception->getMessage(), diff --git a/config/logging.php b/config/logging.php index 10a8b6c9..0961ae20 100644 --- a/config/logging.php +++ b/config/logging.php @@ -73,7 +73,7 @@ return [ 'secret' => env('AWS_CW_SECRET') ] ], - 'retention' => 3, //cief todo: to be updated + 'retention' => 3, //cief todo: retention to be updated 'level' => 'debug', 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), ], @@ -143,11 +143,48 @@ return [ 'level' => 'info', ], + 'vue_polling_vapor' => [ + 'driver' => 'custom', + 'via' => \App\Logging\CloudWatchLoggerFactory::class, + 'formatter' => Monolog\Formatter\JsonFormatter::class, + 'cloudwatch_stream_name' => 'vue_polling_vapor', + 'sdk' => [ + 'region' => env('AWS_MY_REGION'), + 'version' => 'latest', + 'credentials' => [ + 'key' => env('AWS_CW_ACCESS'), + 'secret' => env('AWS_CW_SECRET') + ] + ], + 'retention' => 3, //cief todo: retention to be updated + 'level' => 'debug', + 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), + ], + + 'perfex_crm' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel_perfex_crm.log'), 'level' => 'info', ], + + 'perfex_crm_vapor' => [ + 'driver' => 'custom', + 'via' => \App\Logging\CloudWatchLoggerFactory::class, + 'formatter' => Monolog\Formatter\JsonFormatter::class, + 'cloudwatch_stream_name' => 'perfex_crm_vapor', + 'sdk' => [ + 'region' => env('AWS_MY_REGION'), + 'version' => 'latest', + 'credentials' => [ + 'key' => env('AWS_CW_ACCESS'), + 'secret' => env('AWS_CW_SECRET') + ] + ], + 'retention' => 3, //cief todo: retention to be updated + 'level' => 'debug', + 'groupNamePrefix' => env('CLOUDWATCH_LOGGROUP_PREFIX'), + ], ], ];