Update your Python SDK to version 2.0 for enhanced stability and easier
integration. Learn more
Use cases
- In-depth Analysis: Custom logs provides detailed contextual information about each event in your application’s lifecycle, allowing you to understand how your application is behaving.
- Debugging and Optimization: With detailed provided by custom logs, you can easily identify any errors or performance issues. This makes debugging easier and allows you to optimize your application for better LLM performance.
- Monitoring: Regularly checking custom logs can help you spot any unusual behavior or performance issues early on, allowing you to proactively address potential problems.
How does logging work in the Baserun SDK?
A custom log is simply two properties: thename
and the payload
. The payload is a freeform data structure that you can use however best suits your application.
Example
If you have a chatbot that looks up product information, you may want to include information about that product lookup to provide context for the LLM calls. In this example, we log the results of a function to look up product details: