Answer the question
In order to leave comments, you need to log in
How to use a monologue if there is no way to get a container?
I am doing an action in the transformer, there is no way to get the service container, how to write data to the log?
Answer the question
In order to leave comments, you need to log in
The symphony's monologue bundle wraps the monologue . You can abstract from both and make your own logger. And there already at least use the original, at least a monologue. But still implement PSR LoggerInterface.
Example from documentation:
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
// add records to the log
$log->warning('Foo');
$log->error('Bar');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question