By default, the Monitor tab only displays stdout messages. To capture stderr (error messages) or all output for debugging, you must modify the Logger class in code/chatui/utils/logger.py and update the stream assignments in code/chatui/pages/converse.py.
Option 1: Optional Error Capture
Modify the Logger class to include a capture_errors flag. This allows you to log stderr only when explicitly requested.
Option 2: Capture All Output
Modify the Logger class to include a capture_all flag. This removes filtering and logs everything (including debug messages and internal processing) to the log file.
Caveats
- Capturing all output or errors can create significant noise in the Monitor tab.
- Some error messages may be expected and not represent actual issues.
- Log files will grow larger when capturing more output.
- It is recommended to use these settings temporarily for debugging rather than as a permanent configuration.
# Example: Enabling error capture in code/chatui/pages/converse.py
sys.stdout = logger.Logger("/project/code/output.log", 'stdout')
sys.stderr = logger.Logger("/project/code/output.log", 'stderr', capture_errors=True)
# Example: Enabling capture of all output in code/chatui/pages/converse.py
sys.stdout = logger.Logger("/project/code/output.log", 'stdout', capture_all=True)
sys.stderr = logger.Logger("/project/code/output.log", 'stderr', capture_all=True)