Add additional requirements to logging methods
What does this MR do and why?
This merge request updates the logging mechanism specific to LLM features (located in the llm.log file) to provide more detailed information about the AI's responses and interactions. It adds logging for various events, such as when a response is received from the AI, when an error occurs, and when a specific tool is used. Additionally, it includes the user's information, the class or component that generated the log, and any relevant options or data. This enhanced logging capability will aid in monitoring, debugging, and understanding the behavior of the AI features.
For clarification:
-
log_errorlogs message on error level -
log_debuglogs message on debug level -
log_infologs message on info level -
log_conditional_infologs fully on info level (available at Kibana) only for users withexpanded_ai_loggingfeature flag enabled (which is a small number of team members). Because of this everything that logs user input or llm output should be using this method. If user has feature flag disabled, it logs oninfolevel, but it skips any additional options passed to method - so only logsmessage,class,event_name,ai_component.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
- Make duo chat request.
- Observe llm.log file.
solves #486912 (closed)