mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Laravel Vapor - Look into logs in different channel in cloudwatch
This commit is contained in:
@@ -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(),
|
||||
|
||||
+38
-1
@@ -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'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user