Skip to content

Commit

Permalink
Merge pull request #1068 from AgID/develop
Browse files Browse the repository at this point in the history
Consolidation in master
  • Loading branch information
pdavide authored Jul 31, 2021
2 parents 40bd58d + 04887f3 commit 389c2e7
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 25 deletions.
12 changes: 11 additions & 1 deletion app/Services/SingleDigitalGatewayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Carbon\Carbon;
use GuzzleHttp\Client as APIClient;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\HandlerStack;
use GuzzleLogMiddleware\LogMiddleware;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use JsonSchema\Validator as JsonValidator;

Expand Down Expand Up @@ -132,8 +135,15 @@ public function validatePayload($dataset): void
*/
protected function apiCall(string $path, string $method = 'GET', array $params = [], array $body = null)
{
$apiLogger = Log::channel('sdg_api');
$stack = HandlerStack::create();
$stack->push(new LogMiddleware($apiLogger));

try {
$client = new APIClient(['base_uri' => $this->serviceBaseUri]);
$client = new APIClient([
'base_uri' => $this->serviceBaseUri,
'handler' => $stack,
]);
$options = [
'query' => $params,
'headers' => [
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "italia/wai-portal",
"description": "Web Analytics Italia",
"version": "1.6.6-beta",
"version": "1.6.7-beta",
"keywords": ["analytics", "italia"],
"license": "AGPL-3.0-or-later",
"type": "project",
Expand Down Expand Up @@ -41,6 +41,7 @@
"elasticsearch/elasticsearch": "7.13.*",
"ethanhann/redisearch-php": "^1.0",
"fideloper/proxy": "^4.2",
"gmponos/guzzle_logger": "^2.0",
"guzzlehttp/guzzle": "^7.0",
"italia/spid-laravel": "^1.1.0-beta",
"justinrainbow/json-schema": "^5.2",
Expand Down
88 changes: 79 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
],
],

'sdg_api' => [
'driver' => 'single',
'path' => storage_path('logs/sdg.log'),
'level' => 'debug',
],

'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
Expand Down
20 changes: 7 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"datatables.net-responsive-dt": "^2.2.9",
"eslint": "^7.31.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-vue": "^7.14.0",
"eslint-plugin-vue": "^7.15.0",
"iframe-resizer": "^4.3.2",
"jquery": "^3.6.0",
"laravel-mix": "^5.0.9",
Expand Down

0 comments on commit 389c2e7

Please sign in to comment.