BerriAI/litellm · error · ValueError
No active custom logger found for callback name
Error message
No active custom logger found for callback name: {callback_name} What it means
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.
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
Example fix
# before # MyLogger registered in CustomLoggerRegistry, but never activated litellm.success_callback = ["cold_storage"] # resolving -> ValueError # after from my_app.callbacks import MyColdStorageLogger litellm.callbacks.append(MyColdStorageLogger()) litellm.success_callback = ["cold_storage"]
Defensive patterns
Strategy: validation
Validate before calling
import litellm
from my_app.callbacks import MyCustomLogger
if len(litellm.logging_callback_manager.get_custom_loggers_for_type(MyCustomLogger)) == 0:
litellm.callbacks.append(MyCustomLogger()) Try / catch
try:
logger = litellm.logging_callback_manager.get_active_custom_logger_for_callback_name(name)
except ValueError:
logger = MyCustomLogger()
litellm.callbacks.append(logger) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- litellm_settings.callbacks entry
- Bedrock guardrail failed
- BitBucket configuration not found. Please set…
- Callback param ' ' (from ) contains an 'os.environ/'…
- Database not connected
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/ade14ae7927dc1be.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/litellm_core_utils/logging_callback_manager.py:478
def get_active_custom_logger_for_callback_name(
self,
callback_name: _custom_logger_compatible_callbacks_literal,
) -> CustomLogger | None:
"""
Get the active custom logger for a given callback name
"""
from litellm.litellm_core_utils.custom_logger_registry import (
CustomLoggerRegistry,
)
# get the custom logger class type
custom_logger_class_type: Final = CustomLoggerRegistry.get_class_type_for_custom_logger_name(callback_name)
# get the active custom logger
custom_logger: Final = self.get_custom_loggers_for_type(custom_logger_class_type)
if len(custom_logger) == 0:
raise ValueError(f"No active custom logger found for callback name: {callback_name}")
return custom_logger[0]
View on GitHub (pinned to 77b7c6c40c)