Skip to content

Commit

Permalink
chore: Enable Roadiz dataCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Aug 2, 2024
1 parent 4452f8b commit 986fa15
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 0 additions & 6 deletions lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ services:
- '../src/Traits/'
- '../src/Kernel.php'
- '../src/Tests/'
- '../src/DataCollector/'
- '../src/Event/'
- '../src/Model/'
- '../src/ListManager/'
Expand Down Expand Up @@ -406,11 +405,6 @@ services:
RZ\Roadiz\CoreBundle\SearchEngine\ClientRegistry:
arguments: ['@service_container']

RZ\Roadiz\CoreBundle\SearchEngine\SolariumLogger:
tags:
- { name: data_collector, template: '@RoadizCore/DataCollector/solarium.html.twig', id: 'solarium' }
- { name: monolog.logger, channel: solr }

RZ\Roadiz\CoreBundle\SearchEngine\Indexer\IndexerFactory:
arguments: ['@service_container']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace RZ\Roadiz\CoreBundle\SearchEngine;
namespace RZ\Roadiz\CoreBundle\DataCollector;

use Psr\Log\LoggerInterface;
use Solarium\Core\Client\Endpoint as SolariumEndpoint;
Expand All @@ -13,6 +13,7 @@
use Solarium\Core\Event\PreExecuteRequest as SolariumPreExecuteRequestEvent;
use Solarium\Core\Plugin\AbstractPlugin as SolariumPlugin;
use Symfony\Bundle\FrameworkBundle\DataCollector\TemplateAwareDataCollectorInterface;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request as HttpRequest;
use Symfony\Component\HttpFoundation\Response as HttpResponse;
Expand All @@ -22,6 +23,14 @@
/**
* @see https://github.com/nelmio/NelmioSolariumBundle
*/
#[AutoconfigureTag('data_collector', [
'template' => '@RoadizCore/DataCollector/solarium.html.twig',
# must match the value returned by the getName() method
'id' => 'solarium',
])]
#[AutoconfigureTag('monolog.logger', [
'channel' => 'solr',
])]
final class SolariumLogger extends SolariumPlugin implements DataCollectorInterface, \Serializable, EventSubscriberInterface, TemplateAwareDataCollectorInterface
{
private array $data = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use RZ\Roadiz\CoreBundle\Cache\CloudflareProxyCache;
use RZ\Roadiz\CoreBundle\Cache\ReverseProxyCache;
use RZ\Roadiz\CoreBundle\Cache\ReverseProxyCacheLocator;
use RZ\Roadiz\CoreBundle\DataCollector\SolariumLogger;
use RZ\Roadiz\CoreBundle\Entity\CustomForm;
use RZ\Roadiz\CoreBundle\Entity\Document;
use RZ\Roadiz\CoreBundle\Entity\Node;
Expand All @@ -18,7 +19,6 @@
use RZ\Roadiz\CoreBundle\Entity\NodeType;
use RZ\Roadiz\CoreBundle\Entity\Translation;
use RZ\Roadiz\CoreBundle\Repository\NodesSourcesRepository;
use RZ\Roadiz\CoreBundle\SearchEngine\SolariumLogger;
use RZ\Roadiz\CoreBundle\Webhook\Message\GenericJsonPostMessage;
use RZ\Roadiz\CoreBundle\Webhook\Message\GitlabPipelineTriggerMessage;
use RZ\Roadiz\CoreBundle\Webhook\Message\NetlifyBuildHookMessage;
Expand Down

0 comments on commit 986fa15

Please sign in to comment.