phalcon/cphalcon · error · Phalcon\Logger\Exceptions\NoAdaptersConfigured

No adapters specified

Error message

No adapters specified

What it means

Logger addMessage() guard: a message at/above the log level was requested, but the logger has zero adapters configured, so there is nowhere to send it. Phalcon treats this as a misconfiguration rather than silently dropping the message.

Solutions

  1. Add at least one adapter via addAdapter() before logging
  2. If you intend to drop messages, raise the log level instead of removing all adapters
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Logger/AbstractLogger.zep:319 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/4dbb298424c4a948. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Logger/AbstractLogger.zep:319

        return this;
    }


    /**
     * Adds a message to each handler for processing
     *
     * @throws Exception
     * @throws NoAdaptersConfigured
     */
    protected function addMessage(
        int level,
        string message,
        array context = []
    ) -> bool {
        var adapter, collection, item, levelName, levels;
        if (this->logLevel >= level) {
            if empty this->adapters {
                throw new NoAdaptersConfigured();
            }

            let levels    = this->getLevels(),
                levelName = true === isset(levels[level]) ? levels[level] : levels[Enum::CUSTOM];

            let item = new Item(
                message,
                levelName,
                level,
                this->clock->now(),
                context
            );

            /**
             * Log only if the key does not exist in the excluded ones
             */
            let collection = array_diff_key(this->adapters, this->excluded);
            for adapter in collection {

View on GitHub (pinned to b7419de9cd)