Skip to content

Call to undefined method : NoopLogSink::singletonInstance() #1286

Description

@rse-mfm

Describe the bug

In this file we call the method singletonInstance() of NoopLogSink, but it doesn't exist.

self::$singletonInstance = new LoggerFactory(new LogBackend(LogLevel::OFF, NoopLogSink::singletonInstance()));

To Reproduce
We had an error that trigger the stack trace from Elastic and this error showed up. Here's the full stack trace we had concerning Elastic APM :

/opt/elastic/apm-agent-php/src/ElasticApm/Impl/Log/LoggableStackTrace.php line 62 → Elastic\Apm\Impl\Log\NoopLoggerFactory::singletonInstance()
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/Log/SinkBase.php line 59 → Elastic\Apm\Impl\Log\LoggableStackTrace::buildForCurrent(integer)
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/Log/Backend.php line 129 → Elastic\Apm\Impl\Log\SinkBase->consume(integer, string, array, string, string, integer, string, null, integer)
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/Log/EnabledLoggerProxy.php line 107 → Elastic\Apm\Impl\Log\Backend->log(integer, string, array, integer, string, Elastic\Apm\Impl\Log\LoggerData, null, integer)
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/AutoInstrument/InterceptionManager.php line 120 → Elastic\Apm\Impl\Log\EnabledLoggerProxy->logThrowable(Error, string)
/opt/elastic/apm-agent-php/src/ElasticApm/Impl/AutoInstrument/PhpPartFacade.php line 166 → Elastic\Apm\Impl\AutoInstrument\InterceptionManager->internalFuncCallPreHook(integer, PDOStatement, array)
[internal function] → Elastic\Apm\Impl\AutoInstrument\PhpPartFacade::internalFuncCallPreHook(integer, PDOStatement, array)

Expected behavior
This method should not be called as it doesn't exist ?

Thanks !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions