mardi 15 décembre 2020

How to Cron Job Logs in Sentry laravel

I need to cron job log in sentry using laravel

Call sentry log method:

$this->sentryCronJobLog([
                'affected_rows'=> $affectedRows,
                'status' => 'success'
            ]);  

this method to logged in sentry:

public function sentryCronJobLog($data){
        if (app()->bound('sentry')) {   
            \Sentry\configureScope(function (Scope $scope)use ($data): void {
                $scope->setTag('status', $data['status']);
                $scope->setTag('affected_rows', $data['affected_rows']);
                $scope->setTag('time',\Carbon\Carbon::now()->format('Y-m-d h:i a'));  
            });
        }
    }

In this way, I have unable to create a log in sentry Performance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire