-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Support for custom loggers in runtime_logging #2581
Comments
One option would be to look at Langchain's callback pattern and implement something similar. |
Would it maybe make sense to replace class LoggerFactory:
@staticmethod
def get_logger(logger_cls: Type[BaseLogger] = SqliteLogger, config: Optional[Dict[str, Any]] = None) -> BaseLogger:
if config is None:
config = {}
try:
return logger_cls(config)
except:
raise ValueError(f"[logger_factory] Could not initialize logger with logger class: {logger_cls}") (I don't like the amount of problems that can arise with the logger initialization - might make sense to check that it correctly subclasses |
@ekzhu Until AutoGen makes it big enough for the big players to instrument it automatically, I think there might be a case to be made for providing a set of bindings to e.g. Logfire or OpenLLMetry, or at least provide an example for how to do that. The OTel nature of those loggers should hopefully obviate the parallel execution effects? |
What do you think about this @ekzhu should I also look into this ? |
@shippy for "maintaining the logger" I meant the AutoGen framework in the runtime creating and maintaining the logger object in the framework stack. Providing bindings for telemetry systems seems like something we can do with a custom logger? @krishnashed would love for you to take a look into this. #2596 adds support for custom logger. |
Thanks for the link to the current implementation PR! I think basically what's missing right now is a way to directly expose and wrap the OpenAI/other instrumentation, the way |
@ekzhu we can close this issue right? |
Is your feature request related to a problem? Please describe.
In
runtime_logging
, we currently use a factory method to create a logger in thestart
function when we start logging. This requires us to support all logger backends in our library. We want to support using custom logger for better integration experience.Describe the solution you'd like
In
runtime_logging
:autogen/autogen/runtime_logging.py
Line 23 in 093c1a2
Adding a new parameter
logger: BaseLogger
to allow for custom logger. This logger must implement theBaseLogger
protocol.We can additionally add a logger that simply writes to a file.
Additional context
Related issues and PRs:
#2423
#2516
The text was updated successfully, but these errors were encountered: