Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
Revert "chore: improve validation and handler of logging timezone with TimezoneName" (#10077)
crazywoola0a3d51e9cf20
diff --git a/api/configs/feature/__init__.py b/api/configs/feature/__init__.pyindex a8a4170f670..0fa926038d3 100644--- a/api/configs/feature/__init__.py+++ b/api/configs/feature/__init__.py@@ -10,7 +10,6 @@ from pydantic import (PositiveInt,computed_field,)-from pydantic_extra_types.timezone_name import TimeZoneNamefrom pydantic_settings import BaseSettingsfrom configs.feature.hosted_service import HostedServiceConfig@@ -340,9 +339,8 @@ class LoggingConfig(BaseSettings):default=None,)- LOG_TZ: Optional[TimeZoneName] = Field(- description="Timezone for log timestamps. Allowed timezone values can be referred to IANA Time Zone Database,"- " e.g., 'America/New_York')",+ LOG_TZ: Optional[str] = Field(+ description="Timezone for log timestamps (e.g., 'America/New_York')",default=None,)diff --git a/api/extensions/ext_logging.py b/api/extensions/ext_logging.pyindex 0fa832f4204..56b1d6bd28b 100644--- a/api/extensions/ext_logging.py+++ b/api/extensions/ext_logging.py@@ -1,10 +1,8 @@import loggingimport osimport sys-from datetime import datetimefrom logging.handlers import RotatingFileHandler-import pytzfrom flask import Flaskfrom configs import dify_config@@ -32,10 +30,16 @@ def init_app(app: Flask):handlers=log_handlers,force=True,)-log_tz = dify_config.LOG_TZif log_tz:+ from datetime import datetime++ import pytz++ timezone = pytz.timezone(log_tz)++ def time_converter(seconds):+ return datetime.utcfromtimestamp(seconds).astimezone(timezone).timetuple()+for handler in logging.root.handlers:- handler.formatter.converter = lambda seconds: (- datetime.fromtimestamp(seconds, tz=pytz.UTC).astimezone(log_tz).timetuple()- )+ handler.formatter.converter = time_converter