Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3747216
D2957.id7546.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2957.id7546.diff
View Options
diff --git a/app/Actions/ActionsReport.php b/app/Actions/ActionsReport.php
--- a/app/Actions/ActionsReport.php
+++ b/app/Actions/ActionsReport.php
@@ -2,6 +2,8 @@
namespace Nasqueron\Notifications\Actions;
+use Keruald\OmniTools\Collections\HashMap;
+
class ActionsReport {
/**
* List of actions
@@ -79,6 +81,13 @@
/// Output
///
+ /**
+ * Gets an array representation of the current instance
+ */
+ public function toArray() : array {
+ return HashMap::from($this)->toArray();
+ }
+
/**
* Gets a JSON string representation of the current instance
*/
diff --git a/app/Http/Controllers/Gate/GateController.php b/app/Http/Controllers/Gate/GateController.php
--- a/app/Http/Controllers/Gate/GateController.php
+++ b/app/Http/Controllers/Gate/GateController.php
@@ -2,6 +2,7 @@
namespace Nasqueron\Notifications\Http\Controllers\Gate;
+use Nasqueron\Notifications\Actions\ActionsReport;
use Nasqueron\Notifications\Config\Features;
use Nasqueron\Notifications\Config\Services\Service;
use Nasqueron\Notifications\Facades\Services;
@@ -75,10 +76,21 @@
$report = App::make('report');
$statusCode = $report->containsError() ? 503 : 200;
+
+ $this->logResponse($report, $statusCode);
+
return Response::json($report)
->setStatusCode($statusCode);
}
+ /**
+ * Logs the action reports sent as response by the controller
+ */
+ protected function logResponse (ActionsReport $report, int $statusCode) : void {
+ Log::info("[Gate] Actions report.", $report->toArray());
+ Log::info("[Gate] Response is HTTP $statusCode");
+ }
+
///
/// Credentials
///
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -17,6 +17,7 @@
"keruald/github": "^0.2.1",
"keruald/broker": "^0.5.0",
"keruald/mailgun": "^0.1.0",
+ "keruald/omnitools": "^0.8.0",
"netresearch/jsonmapper": "^1.1.1",
"sentry/sentry-laravel": "^3.2"
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 01:02 (20 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2248368
Default Alt Text
D2957.id7546.diff (1 KB)
Attached To
Mode
D2957: Log gate response
Attached
Detach File
Event Timeline
Log In to Comment