Skip to content

Missing logger - errors are thrown away #88

@enumag

Description

@enumag

Hello, I found a bug in

private static function buildReporter(ContainerInterface $container)
{
$reporterName = $container->getParameter('zipkin.reporter.type');
switch ($reporterName) {
default:
case 'log':
$logger = $container->get('logger');
return new Log($logger);
case 'noop':
return new Noop();
break;
case 'http':
return new Http($container->getParameter('zipkin.reporter.http') ?: []);
}
}

I was using the Http reporter but configured it with wrong URL. This case is handled by the reporter and logged into logger. However here you're creating the reporter without passing the logger service so NullLogger is used instead and the errors are thrown away.

Also using $logger = $container->get('logger'); is a bad idea. I tried and it failed with this:

[critical] Uncaught Exception: The "logger" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions