Logging
The Copilot bundle uses Symfony's default Monolog logging to record messages under the pimcore_copilot channel.
The bundle registers the channel but configures no dedicated handler, so entries go to the handlers configured in your
application (by default var/log/<env>-debug.log and var/log/<env>-error.log). To route them into a separate file,
add a Monolog handler scoped to the pimcore_copilot channel.
For details on configuring the logger, see Symfony's Monolog documentation.
Using the Logger
To log messages from your own code, inject the Copilot logger service into your class.
<?php
use Psr\Log\LoggerInterface;
class LogExample
{
public function __construct
(
private readonly LoggerInterface $pimcoreCopilotLogger,
) {
}
public function logInfoMessage(): void
{
$this->pimcoreCopilotLogger->info("This is an info message");
}
}