{"record":{"id":"ade14ae7927dc1be","repo":"BerriAI/litellm","slug":"no-active-custom-logger-found-for-callback-name","errorCode":null,"errorMessage":"No active custom logger found for callback name: {callback_name}","messagePattern":"No active custom logger found for callback name: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/logging_callback_manager.py","lineNumber":478,"sourceCode":"    def get_active_custom_logger_for_callback_name(\n        self,\n        callback_name: _custom_logger_compatible_callbacks_literal,\n    ) -> CustomLogger | None:\n        \"\"\"\n        Get the active custom logger for a given callback name\n        \"\"\"\n        from litellm.litellm_core_utils.custom_logger_registry import (\n            CustomLoggerRegistry,\n        )\n\n        # get the custom logger class type\n        custom_logger_class_type: Final = CustomLoggerRegistry.get_class_type_for_custom_logger_name(callback_name)\n\n        # get the active custom logger\n        custom_logger: Final = self.get_custom_loggers_for_type(custom_logger_class_type)\n\n        if len(custom_logger) == 0:\n            raise ValueError(f\"No active custom logger found for callback name: {callback_name}\")\n\n        return custom_logger[0]\n","sourceCodeStart":460,"sourceCodeEnd":481,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/logging_callback_manager.py#L460-L481","documentation":"LoggingCallbackManager.get_active_custom_logger_for_callback_name() resolves a callback name to a live CustomLogger: it looks the class up in CustomLoggerRegistry, then searches active callbacks for an instance of that type. If the name maps to a class but no instance is currently attached (nothing in litellm.callbacks / the proxy callback lists), it raises ValueError. Callers include the proxy's cold-storage spend handler and standard logging payload setup.","triggerScenarios":"Proxy or SDK config references a registered custom callback by name (e.g. a cold_storage custom_logger) but the class was never instantiated into the active callback lists - missing entry in config.yaml callbacks, a bad module path so the server never imported it, or litellm.callbacks reassigned/emptied after registration.","commonSituations":"Registering a CustomLogger class with the registry but forgetting litellm.callbacks = [MyHandler()]; proxy config listing the logger under the wrong yaml section so it never activates; tests that overwrite litellm.callbacks between requests; typos in the module path of the callback entry.","solutions":["Instantiate and activate the logger before the request that resolves the name: litellm.callbacks.append(MyCustomLogger()) (append, don't replace)","On the proxy, declare the callback in config.yaml's callbacks list with its full module.path:ClassName so the server instantiates it at startup","Verify activation: len(litellm.logging_callback_manager.get_custom_loggers_for_type(MyCustomLogger)) > 0","Audit for code that reassigns litellm.callbacks = [...] later and wipes the active instance"],"exampleFix":"# before\n# MyLogger registered in CustomLoggerRegistry, but never activated\nlitellm.success_callback = [\"cold_storage\"]  # resolving -> ValueError\n\n# after\nfrom my_app.callbacks import MyColdStorageLogger\nlitellm.callbacks.append(MyColdStorageLogger())\nlitellm.success_callback = [\"cold_storage\"]","handlingStrategy":"validation","validationCode":"import litellm\nfrom my_app.callbacks import MyCustomLogger\n\nif len(litellm.logging_callback_manager.get_custom_loggers_for_type(MyCustomLogger)) == 0:\n    litellm.callbacks.append(MyCustomLogger())","typeGuard":null,"tryCatchPattern":"try:\n    logger = litellm.logging_callback_manager.get_active_custom_logger_for_callback_name(name)\nexcept ValueError:\n    logger = MyCustomLogger()\n    litellm.callbacks.append(logger)","preventionTips":["Register and activate together: appending the instance to litellm.callbacks right after registration","On the proxy, give every custom callback a config.yaml callbacks entry with its full module path","Never reassign litellm.callbacks wholesale after setup - append instead"],"tags":["litellm","callbacks","custom-logger","configuration","proxy"],"backgroundTag":"missing-configuration","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}