fix(serve): enable file logging for HTTP API sessions via file_logconfig field - #331
fix(serve): enable file logging for HTTP API sessions via file_logconfig field#331kun-codes wants to merge 2 commits into
file_logconfig field#331Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR extends the FastAPI session-start endpoint configuration model so HTTP API callers can enable file-based logging per session via a new file_log boolean field.
Changes:
- Add
file_log: bool = Falseto the RESTSessionConfigmodel. - Pass
file_loginto the internalConfigused to create a session.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| project_path=config.project_path, | ||
| log_level=LOG_LEVEL_DEBUG | ||
| log_level=LOG_LEVEL_DEBUG, | ||
| file_log=file_log | ||
| ) | ||
| templates = ( |
| appium_url: Optional[str] = None | ||
| appium_config: Optional[Dict[str, Any]] = None | ||
| api_data: Optional[Dict[str, Any]] = None # Inline API definitions only; file path not supported in REST | ||
| file_log: bool = False |
|
how to do you plan to fetch the file logs from containers? |
|
@malto101 How about using docker volume mounts to store the logs from the container on the host system? when And when file logging isn't required, logs go to |
That works, just double check if there's a export logs option in docker or other container services so we do not duplicate work |
|
@malto101 |
right, |



Before this PR, no log files were being written to using
optics serve.After this PR, file logging can be enabled using
"file_log": true,in request body forPOST {{baseUrl}}/v1/sessions/start