@@ -213,9 +218,11 @@ function StepArtifacts({ id, stepProps }: Props) {
{llmRequest ? : null}
-
- {skyvernLog ? : null}
-
+ {enable_log_artifacts && (
+
+ {skyvernLog ? : null}
+
+ )}
);
}
diff --git a/skyvern/config.py b/skyvern/config.py
index a1cbd4563..20ac18c0b 100644
--- a/skyvern/config.py
+++ b/skyvern/config.py
@@ -131,6 +131,8 @@ class Settings(BaseSettings):
SVG_MAX_LENGTH: int = 100000
+ ENABLE_LOG_ARTIFACTS: bool = False
+
def is_cloud_environment(self) -> bool:
"""
:return: True if env is not local, else False
diff --git a/skyvern/forge/sdk/log_artifacts.py b/skyvern/forge/sdk/log_artifacts.py
index 1d555abdc..11ac5e2ec 100644
--- a/skyvern/forge/sdk/log_artifacts.py
+++ b/skyvern/forge/sdk/log_artifacts.py
@@ -2,6 +2,8 @@
import structlog
+from skyvern.config import settings
+
from skyvern.forge import app
from skyvern.forge.sdk.artifact.models import ArtifactType, LogEntityType
from skyvern.forge.sdk.core import skyvern_context
@@ -10,7 +12,6 @@
LOG = structlog.get_logger()
-
def primary_key_from_log_entity_type(log_entity_type: LogEntityType) -> str:
if log_entity_type == LogEntityType.STEP:
return "step_id"
@@ -25,6 +26,9 @@ def primary_key_from_log_entity_type(log_entity_type: LogEntityType) -> str:
async def save_step_logs(step_id: str) -> None:
+ if not settings.ENABLE_LOG_ARTIFACTS:
+ return
+
context = skyvern_context.ensure_context()
log = context.log
organization_id = context.organization_id
@@ -41,6 +45,9 @@ async def save_step_logs(step_id: str) -> None:
async def save_task_logs(task_id: str) -> None:
+ if not settings.ENABLE_LOG_ARTIFACTS:
+ return
+
context = skyvern_context.ensure_context()
log = context.log
organization_id = context.organization_id
@@ -57,6 +64,9 @@ async def save_task_logs(task_id: str) -> None:
async def save_workflow_run_logs(workflow_run_id: str) -> None:
+ if not settings.ENABLE_LOG_ARTIFACTS:
+ return
+
context = skyvern_context.ensure_context()
log = context.log
organization_id = context.organization_id
@@ -73,6 +83,9 @@ async def save_workflow_run_logs(workflow_run_id: str) -> None:
async def save_workflow_run_block_logs(workflow_run_block_id: str) -> None:
+ if not settings.ENABLE_LOG_ARTIFACTS:
+ return
+
context = skyvern_context.ensure_context()
log = context.log
organization_id = context.organization_id
@@ -100,6 +113,9 @@ async def _save_log_artifacts(
workflow_run_block_id: str | None = None,
) -> None:
try:
+ if not settings.ENABLE_LOG_ARTIFACTS:
+ return
+
log_json = json.dumps(log, cls=SkyvernJSONLogEncoder, indent=2)
log_artifact = await app.DATABASE.get_artifact_by_entity_id(