Disable logs #3761
-
|
I have a flow that creates fairly large output. The logs would grow very rapidly, after which opening the flow in the ide would become very irresponsive. Is it possible to disable logs for a specific flow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hey @lianggecm! I'm here to help you with any bugs, questions, or contributions you have. Let me know how I can assist you! Yes, it is possible to disable logs for a specific flow to prevent large output and improve IDE responsiveness. You can use the Here is the relevant code snippet: def load_flow_from_json(
flow: Union[Path, str, dict],
tweaks: Optional[dict] = None,
log_level: Optional[str] = None,
log_file: Optional[str] = None,
env_file: Optional[str] = None,
cache: Optional[str] = None,
disable_logs: Optional[bool] = True,
) -> Graph:
log_file_path = Path(log_file) if log_file else None
configure(log_level=log_level, log_file=log_file_path, disable=disable_logs)
# ... rest of the function
def run_flow_from_json(
flow: Union[Path, str, dict],
input_value: str,
tweaks: Optional[dict] = None,
input_type: str = "chat",
output_type: str = "chat",
output_component: Optional[str] = None,
log_level: Optional[str] = None,
log_file: Optional[str] = None,
env_file: Optional[str] = None,
cache: Optional[str] = None,
disable_logs: Optional[bool] = True,
fallback_to_env_vars: bool = False,
) -> List[RunOutputs]:
graph = load_flow_from_json(
flow=flow,
tweaks=tweaks,
log_level=log_level,
log_file=log_file,
env_file=env_file,
cache=cache,
disable_logs=disable_logs,
)
result = run_graph(
graph=graph,
input_value=input_value,
input_type=input_type,
output_type=output_type,
output_component=output_component,
fallback_to_env_vars=fallback_to_env_vars,
)
return resultSet the |
Beta Was this translation helpful? Give feedback.
-
|
hello there , how do i do this from environment variables or flow configuration without writing anything to transaction table in postgres. At high loads we are getting severe deadlocks on transaction tables and i have no real use for it |
Beta Was this translation helpful? Give feedback.
Hey @lianggecm! I'm here to help you with any bugs, questions, or contributions you have. Let me know how I can assist you!
Yes, it is possible to disable logs for a specific flow to prevent large output and improve IDE responsiveness. You can use the
disable_logsparameter in theload_flow_from_jsonandrun_flow_from_jsonfunctions to disable logging for the flow processing.Here is the relevant code snippet: