Seldaek/monolog · error · BadMethodCallException

Call to undefined method {}::{}()

Error message

Call to undefined method {}::{}()

What it means

Error "Call to undefined method {}::{}()" thrown in Seldaek/monolog.

Source

Thrown at src/Monolog/Handler/TestHandler.php:201

    /**
     * @param mixed[] $args
     */
    #[NoDiscard]
    public function __call(string $method, array $args): bool
    {
        if ((bool) preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches)) {
            $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
            $level = \constant(Level::class.'::' . $matches[2]);
            $callback = [$this, $genericMethod];
            if (\is_callable($callback)) {
                $args[] = $level;

                return \call_user_func_array($callback, $args);
            }
        }

        throw new \BadMethodCallException('Call to undefined method ' . \get_class($this) . '::' . $method . '()');
    }
}

View on GitHub (pinned to 57eb102834)

When it happens

Trigger: Thrown at src/Monolog/Handler/TestHandler.php:201 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Seldaek/monolog@57eb102834 (2026-08-17). Data as JSON: /api/errors/e65ae9a5361007d6. Report an issue: GitHub.