Hi @luceos I've done this but interesting the nothing inside $container->resolving('log') fires.
So my Extender looks like this:
use Flarum\Extend\ExtenderInterface;
use Illuminate\Contracts\Container\Container;
use Flarum\Extension\Extension;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
class Log implements ExtenderInterface
{
public function extend(Container $container, Extension $extension = null)
{
//var_dump($container->resolved('log'));exit;
$container->resolving('log', function (\Monolog\Logger $logger) {
//var_dump('inside');exit;
$handler = new StreamHandler('php://stdout', Logger::DEBUG);
$handler->setFormatter(new LineFormatter(null, null, true, true));
$logger->pushHandler($handler);
return $logger;
});
}
}
In extend.php, I'm doing this:
return [
// Enable logging to console instead of disk
new Log()
];
Interestingly, the var_dump always fires as true, which means by the time it gets here, the log alias has already resolved. So the resolving never fires.
What am I doing wrong?
Thank you very much for your help!