From 42c395ecc9221e0d88c8a7792cd583cf8f377a3a Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 20 Sep 2022 17:12:41 +0200 Subject: [PATCH] export: add logger to make feedback on deployed instances easier to debug --- src/Bundle/ChillMainBundle/Controller/ExportController.php | 6 ++++++ src/Bundle/ChillMainBundle/Export/ExportManager.php | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index ffd73b777..4ced2cacc 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -442,6 +442,12 @@ class ExportController extends AbstractController } $rawData = unserialize($serialized); + + $this->logger->notice('[export] choices for an export unserialized', [ + 'key' => $key, + 'rawData' => json_encode($rawData) + ]); + $alias = $rawData['alias']; $formCenters = $this->createCreateFormExport($alias, 'generate_centers'); diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index c1384a3b8..df14a8ac8 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -264,15 +264,17 @@ class ExportManager //handle aggregators $this->handleAggregators($export, $query, $data[ExportType::AGGREGATOR_KEY], $centers); - $this->logger->debug('current query is ' . $query->getDQL(), [ - 'class' => self::class, 'function' => __FUNCTION__, + $this->logger->notice('[export] will execute this qb in export', [ + 'dql' => $query->getDQL() ]); + } else { throw new UnexpectedValueException('The method `intiateQuery` should return ' . 'a `\\Doctrine\\ORM\\NativeQuery` or a `Doctrine\\ORM\\QueryBuilder` ' . 'object.'); } + $result = $export->getResult($query, $data[ExportType::EXPORT_KEY]); if (!is_iterable($result)) {