export: add logger to make feedback on deployed instances easier to debug

This commit is contained in:
Mathieu Jaumotte 2022-09-20 17:12:41 +02:00
parent 052c0e1969
commit 42c395ecc9
2 changed files with 10 additions and 2 deletions

View File

@ -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');

View File

@ -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)) {