Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Exceptions;

use CloudLogger;
use Config;
use Throwable;
use Illuminate\Http\Request;
Expand Down Expand Up @@ -77,6 +78,14 @@ public function render($request, Throwable $e): mixed
];
}

if (env('GOOGLE_CLOUD_LOGGING_ENABLED')) {
CloudLogger::write([
'action_type' => 'EXCEPTION',
'action_message' => $response['message'],
'details' => $response['details'],
]);
}

return response()->json($response, $statusCode);
}
}
25 changes: 13 additions & 12 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ fi
# Start the Octane server in the background
$base_command &

# Separate the command from the cron timings, so as to first check for
# duplicates, thus being immune to multiple insertions
cronCommand="/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1"
cronJob="* * * * * $cronCommand"
# for the dev, preprod and prod environment the scheduler was moved based on google scheduler.
if [ "$APP_ENV" = 'local' ]; then
# Separate the command from the cron timings, so as to first check for
# duplicates, thus being immune to multiple insertions
cronCommand="/usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1"
cronJob="* * * * * $cronCommand"

# To add the above to local crontab
( crontab -l | grep -v -F "$cronCommand" ; echo "$cronJob" ) | crontab -
# To add the above to local crontab
( crontab -l | grep -v -F "$cronCommand" ; echo "$cronJob" ) | crontab -

## To remove the above from local crontab
# ( crontab -l | grep -v -F "$cronCommand" ) | crontab -
## To remove the above from local crontab
# ( crontab -l | grep -v -F "$cronCommand" ) | crontab -

# To activate cron service
service cron start
# To activate cron service
service cron start
fi

php artisan horizon


Loading