Unused repository implementations: LogstoreWorkflowExecutionRepository and LogstoreWorkflowNodeExecutionRepository are never referenced or instantiated #21380

Closed
opened 2026-02-21 20:12:17 -05:00 by yindo · 2 comments
Owner

Originally created by @scdeng on GitHub (Dec 30, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.2

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Description:
When enabling the Aliyun SLS logstore extension in the open-source version by setting all required environment variables:

ALIYUN_SLS_ACCESS_KEY_ID=xxxx
ALIYUN_SLS_ACCESS_KEY_SECRET=xxxx
ALIYUN_SLS_ENDPOINT=cn-hangzhou.log.aliyuncs.com
ALIYUN_SLS_REGION=cn-hangzhou
ALIYUN_SLS_PROJECT_NAME=dify-workflow-logs
LOGSTORE_DUAL_WRITE_ENABLED=true

the extension (ext_logstore) successfully initializes on application startup:

  • Creates the specified Project in Aliyun SLS
  • Creates required Logstores (workflow_execution, workflow_node_execution)
  • Creates Indexes according to schema mapping

Initialization works as expected.

However, during actual workflow execution:

  • No data is written into the Aliyun SLS logstores
  • SLS remains empty except for its definitions
  • PostgreSQL tables continue to store workflow execution and node execution logs as usual

This suggests that runtime persistence is not wired to the Logstore repositories (LogstoreWorkflowExecutionRepository, LogstoreWorkflowNodeExecutionRepository) in the open-source version.

I performed a full-text search across the repository for:

  • The class names (LogstoreWorkflowExecutionRepository, LogstoreWorkflowNodeExecutionRepository)

  • String literals "LogstoreWorkflowExecutionRepository", "LogstoreWorkflowNodeExecutionRepository"

  • No occurrences were found outside their own definition files. This means they are not imported, not used via reflection, and not hooked into any factory or dependency injection mechanism in the open-source code.


Steps to Reproduce:

  1. Configure all Aliyun SLS environment variables as above
  2. Start the Dify open-source application with SLS enabled (is_enabled() returns True for ext_logstore)
  3. Run workflows that generate execution/node logs
  4. Check SLS logstore contents — see that Project/Logstore/Index exist, but no logs are written

✔️ Expected Behavior

Expected Behavior:
When SLS extension is enabled, runtime log writes for WorkflowExecution and WorkflowNodeExecution should be routed to Aliyun SLS (either:

  • single write: only to SLS, or
  • dual write: to both SLS and PostgreSQL, if LOGSTORE_DUAL_WRITE_ENABLED=true),

so that logs appear in SLS in real time.

Actual Behavior

Actual Behavior:
Only Aliyun SLS structures are initialized at startup. Log data continues to be persisted exclusively to the PostgreSQL backend via SQLAlchemy repositories. The Logstore repository implementations appear never to be instantiated, even with all SLS environment configuration applied.


Relevant Code / Observations:

  • ext_logstore.init_app() runs and puts AliyunLogStore() client in app.extensions["logstore"]
  • LogstoreWorkflowExecutionRepository & LogstoreWorkflowNodeExecutionRepository implement the correct interfaces but are not referenced/imported from anywhere in open-source code.

Impact:
This makes Aliyun SLS integration non-functional for runtime log storage in the open-source release, despite appearing as a configurable option.


Environment:

  • Python version: (e.g. 3.12)
  • Aliyun SLS region: cn-hangzhou
Originally created by @scdeng on GitHub (Dec 30, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.2 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce **Description:** When enabling the Aliyun SLS logstore extension in the open-source version by setting all required environment variables: ```env ALIYUN_SLS_ACCESS_KEY_ID=xxxx ALIYUN_SLS_ACCESS_KEY_SECRET=xxxx ALIYUN_SLS_ENDPOINT=cn-hangzhou.log.aliyuncs.com ALIYUN_SLS_REGION=cn-hangzhou ALIYUN_SLS_PROJECT_NAME=dify-workflow-logs LOGSTORE_DUAL_WRITE_ENABLED=true ``` the extension (`ext_logstore`) successfully initializes on application startup: - Creates the specified **Project** in Aliyun SLS - Creates required **Logstores** (`workflow_execution`, `workflow_node_execution`) - Creates **Indexes** according to schema mapping ✅ Initialization works as expected. However, during actual workflow execution: - No data is written into the Aliyun SLS logstores - SLS remains empty except for its definitions - PostgreSQL tables continue to store workflow execution and node execution logs as usual This suggests that **runtime persistence** is not wired to the Logstore repositories (`LogstoreWorkflowExecutionRepository`, `LogstoreWorkflowNodeExecutionRepository`) in the open-source version. I performed a full-text search across the repository for: - The class names (`LogstoreWorkflowExecutionRepository`, `LogstoreWorkflowNodeExecutionRepository`) - String literals `"LogstoreWorkflowExecutionRepository"`, `"LogstoreWorkflowNodeExecutionRepository"` - No occurrences were found outside their own definition files. This means they are not imported, not used via reflection, and not hooked into any factory or dependency injection mechanism **in the open-source code**. --- **Steps to Reproduce:** 1. Configure all Aliyun SLS environment variables as above 2. Start the Dify open-source application with SLS enabled (`is_enabled()` returns True for `ext_logstore`) 3. Run workflows that generate execution/node logs 4. Check SLS logstore contents — see that Project/Logstore/Index exist, but no logs are written ### ✔️ Expected Behavior **Expected Behavior:** When SLS extension is enabled, runtime log writes for `WorkflowExecution` and `WorkflowNodeExecution` should be routed to Aliyun SLS (either: - **single write**: only to SLS, or - **dual write**: to both SLS and PostgreSQL, if `LOGSTORE_DUAL_WRITE_ENABLED=true`), so that logs appear in SLS in real time. ### ❌ Actual Behavior **Actual Behavior:** Only Aliyun SLS structures are initialized at startup. Log data continues to be persisted exclusively to the PostgreSQL backend via SQLAlchemy repositories. The Logstore repository implementations appear never to be instantiated, even with all SLS environment configuration applied. --- **Relevant Code / Observations:** - `ext_logstore.init_app()` runs and puts `AliyunLogStore()` client in `app.extensions["logstore"]` - `LogstoreWorkflowExecutionRepository` & `LogstoreWorkflowNodeExecutionRepository` implement the correct interfaces but are not referenced/imported from anywhere in open-source code. --- **Impact:** This makes Aliyun SLS integration non-functional for runtime log storage in the open-source release, despite appearing as a configurable option. --- **Environment:** - Python version: (e.g. 3.12) - Aliyun SLS region: cn-hangzhou
yindo added the 🐞 bug label 2026-02-21 20:12:17 -05:00
yindo closed this issue 2026-02-21 20:12:17 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 30, 2025):

The LogstoreWorkflowExecutionRepository and LogstoreWorkflowNodeExecutionRepository are not used by default because Dify selects repository implementations at runtime based on configuration. By default, the environment variables CORE_WORKFLOW_EXECUTION_REPOSITORY and CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY point to the SQLAlchemy-based repositories, so logs are only written to PostgreSQL, not Aliyun SLS. The Logstore repositories are fully implemented and support both single-write (SLS only) and dual-write (SLS + SQL) modes, but you must explicitly configure them to be used at runtime.

To enable Aliyun SLS log writing, set these environment variables in your .env file:

CORE_WORKFLOW_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository
CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository

Make sure all required Aliyun SLS variables are set (ALIYUN_SLS_ACCESS_KEY_ID, ALIYUN_SLS_ACCESS_KEY_SECRET, ALIYUN_SLS_ENDPOINT, ALIYUN_SLS_REGION, ALIYUN_SLS_PROJECT_NAME). The LOGSTORE_DUAL_WRITE_ENABLED variable controls whether logs are written to both SLS and PostgreSQL (true for dual-write, false for SLS only) — it defaults to true for safe migration cite.

After updating your configuration, restart the application. New workflow execution and node execution logs should now appear in Aliyun SLS in real time. If logs still do not show up, check for typos in the class paths, verify your SLS credentials and permissions, and review application logs for errors during log writing cite.

This approach is production-ready and was merged to address performance and scalability issues with high-volume workflow logs in PostgreSQL cite. Manual testing with your SLS credentials is recommended to confirm the integration.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 30, 2025): <!-- Answer --> The LogstoreWorkflowExecutionRepository and LogstoreWorkflowNodeExecutionRepository are not used by default because Dify selects repository implementations at runtime based on configuration. By default, the environment variables CORE_WORKFLOW_EXECUTION_REPOSITORY and CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY point to the SQLAlchemy-based repositories, so logs are only written to PostgreSQL, not Aliyun SLS. The Logstore repositories are fully implemented and support both single-write (SLS only) and dual-write (SLS + SQL) modes, but you must explicitly configure them to be used at runtime. To enable Aliyun SLS log writing, set these environment variables in your .env file: ```env CORE_WORKFLOW_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository ``` Make sure all required Aliyun SLS variables are set (ALIYUN_SLS_ACCESS_KEY_ID, ALIYUN_SLS_ACCESS_KEY_SECRET, ALIYUN_SLS_ENDPOINT, ALIYUN_SLS_REGION, ALIYUN_SLS_PROJECT_NAME). The LOGSTORE_DUAL_WRITE_ENABLED variable controls whether logs are written to both SLS and PostgreSQL (`true` for dual-write, `false` for SLS only) — it defaults to `true` for safe migration [cite](https://github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/.env.example#L525-L563). After updating your configuration, restart the application. New workflow execution and node execution logs should now appear in Aliyun SLS in real time. If logs still do not show up, check for typos in the class paths, verify your SLS credentials and permissions, and review application logs for errors during log writing [cite](https://github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/core/repositories/factory.py#L22-L109). This approach is production-ready and was merged to address performance and scalability issues with high-volume workflow logs in PostgreSQL [cite](https://github.com/langgenius/dify/pull/28986). Manual testing with your SLS credentials is recommended to confirm the integration. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20LogstoreWorkflowExecutionRepository%20and%20LogstoreWorkflowNodeExecutionRepository%20are%20not%20used%20by%20default%20because%20Dify%20selects%20repository%20implementations%20at%20runtime%20based%20on%20configuration.%20By%20default%2C%20the%20environment%20variables%20CORE_WORKFLOW_EXECUTION_REPOSITORY%20and%20CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY%20point%20to%20the%20SQLAlchemy-based%20repositories%2C%20so%20logs%20are%20only%20written%20to%20PostgreSQL%2C%20not%20Aliyun%20SLS.%20The%20Logstore%20repositories%20are%20fully%20implemented%20and%20support%20both%20single-write%20%28SLS%20only%29%20and%20dual-write%20%28SLS%20%2B%20SQL%29%20modes%2C%20but%20you%20must%20explicitly%20configure%20them%20to%20be%20used%20at%20runtime.%0A%0ATo%20enable%20Aliyun%20SLS%20log%20writing%2C%20set%20these%20environment%20variables%20in%20your%20.env%20file%3A%0A%0A%60%60%60env%0ACORE_WORKFLOW_EXECUTION_REPOSITORY%3Dextensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository%0ACORE_WORKFLOW_NODE_EXECUTION_REPOSITORY%3Dextensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository%0A%60%60%60%0A%0AMake%20sure%20all%20required%20Aliyun%20SLS%20variables%20are%20set%20%28ALIYUN_SLS_ACCESS_KEY_ID%2C%20ALIYUN_SLS_ACCESS_KEY_SECRET%2C%20ALIYUN_SLS_ENDPOINT%2C%20ALIYUN_SLS_REGION%2C%20ALIYUN_SLS_PROJECT_NAME%29.%20The%20LOGSTORE_DUAL_WRITE_ENABLED%20variable%20controls%20whether%20logs%20are%20written%20to%20both%20SLS%20and%20PostgreSQL%20%28%60true%60%20for%20dual-write%2C%20%60false%60%20for%20SLS%20only%29%C2%A0%E2%80%94%C2%A0it%20defaults%20to%20%60true%60%20for%20safe%20migration%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/.env.example%23L525-L563%29.%0A%0AAfter%20updating%20your%20configuration%2C%20restart%20the%20application.%20New%20workflow%20execution%20and%20node%20execution%20logs%20should%20now%20appear%20in%20Aliyun%20SLS%20in%20real%20time.%20If%20logs%20still%20do%20not%20show%20up%2C%20check%20for%20typos%20in%20the%20class%20paths%2C%20verify%20your%20SLS%20credentials%20and%20permissions%2C%20and%20review%20application%20logs%20for%20errors%20during%20log%20writing%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/core/repositories/factory.py%23L22-L109%29.%0A%0AThis%20approach%20is%20production-ready%20and%20was%20merged%20to%20address%20performance%20and%20scalability%20issues%20with%20high-volume%20workflow%20logs%20in%20PostgreSQL%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/pull/28986%29.%20Manual%20testing%20with%20your%20SLS%20credentials%20is%20recommended%20to%20confirm%20the%20integration.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/30405)
Author
Owner

@scdeng commented on GitHub (Jan 1, 2026):

The LogstoreWorkflowExecutionRepository and LogstoreWorkflowNodeExecutionRepository are not used by default because Dify selects repository implementations at runtime based on configuration. By default, the environment variables CORE_WORKFLOW_EXECUTION_REPOSITORY and CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY point to the SQLAlchemy-based repositories, so logs are only written to PostgreSQL, not Aliyun SLS. The Logstore repositories are fully implemented and support both single-write (SLS only) and dual-write (SLS + SQL) modes, but you must explicitly configure them to be used at runtime.

To enable Aliyun SLS log writing, set these environment variables in your .env file:

CORE_WORKFLOW_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository
CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository
Make sure all required Aliyun SLS variables are set (ALIYUN_SLS_ACCESS_KEY_ID, ALIYUN_SLS_ACCESS_KEY_SECRET, ALIYUN_SLS_ENDPOINT, ALIYUN_SLS_REGION, ALIYUN_SLS_PROJECT_NAME). The LOGSTORE_DUAL_WRITE_ENABLED variable controls whether logs are written to both SLS and PostgreSQL (true for dual-write, false for SLS only) — it defaults to true for safe migration cite.

After updating your configuration, restart the application. New workflow execution and node execution logs should now appear in Aliyun SLS in real time. If logs still do not show up, check for typos in the class paths, verify your SLS credentials and permissions, and review application logs for errors during log writing cite.

This approach is production-ready and was merged to address performance and scalability issues with high-volume workflow logs in PostgreSQL cite. Manual testing with your SLS credentials is recommended to confirm the integration.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

Issue resolved! The provided solution was clear and effective. Thank you for your prompt assistance and for maintaining this great project!

@scdeng commented on GitHub (Jan 1, 2026): > The LogstoreWorkflowExecutionRepository and LogstoreWorkflowNodeExecutionRepository are not used by default because Dify selects repository implementations at runtime based on configuration. By default, the environment variables CORE_WORKFLOW_EXECUTION_REPOSITORY and CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY point to the SQLAlchemy-based repositories, so logs are only written to PostgreSQL, not Aliyun SLS. The Logstore repositories are fully implemented and support both single-write (SLS only) and dual-write (SLS + SQL) modes, but you must explicitly configure them to be used at runtime. > > To enable Aliyun SLS log writing, set these environment variables in your .env file: > > CORE_WORKFLOW_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository > CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY=extensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository > Make sure all required Aliyun SLS variables are set (ALIYUN_SLS_ACCESS_KEY_ID, ALIYUN_SLS_ACCESS_KEY_SECRET, ALIYUN_SLS_ENDPOINT, ALIYUN_SLS_REGION, ALIYUN_SLS_PROJECT_NAME). The LOGSTORE_DUAL_WRITE_ENABLED variable controls whether logs are written to both SLS and PostgreSQL (`true` for dual-write, `false` for SLS only) — it defaults to `true` for safe migration [cite](https://github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/.env.example#L525-L563). > > After updating your configuration, restart the application. New workflow execution and node execution logs should now appear in Aliyun SLS in real time. If logs still do not show up, check for typos in the class paths, verify your SLS credentials and permissions, and review application logs for errors during log writing [cite](https://github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/core/repositories/factory.py#L22-L109). > > This approach is production-ready and was merged to address performance and scalability issues with high-volume workflow logs in PostgreSQL [cite](https://github.com/langgenius/dify/pull/28986). Manual testing with your SLS credentials is recommended to confirm the integration. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a291f7cd-2ce2-4fa4-893b-5eb4a9ca3b04?feedback_type=other) > > [![Chat with Dosu](https://camo.githubusercontent.com/7c571478962a6b8a5d47cac74b6824c75e4f6731bba52377e6007f9150462923/68747470733a2f2f646f73752e6465762f646f73752d636861742d62616467652e737667)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github) [![Open in Cursor](https://camo.githubusercontent.com/bdf7dbded65ee585887f47e5fd6fa099ea0933088b4b03d02e83b4def50154d4/68747470733a2f2f646f73752e6465762f646f73752d696e2d637572736f722e737667)](https://cursor.com/link/prompt?text=The%20LogstoreWorkflowExecutionRepository%20and%20LogstoreWorkflowNodeExecutionRepository%20are%20not%20used%20by%20default%20because%20Dify%20selects%20repository%20implementations%20at%20runtime%20based%20on%20configuration.%20By%20default%2C%20the%20environment%20variables%20CORE_WORKFLOW_EXECUTION_REPOSITORY%20and%20CORE_WORKFLOW_NODE_EXECUTION_REPOSITORY%20point%20to%20the%20SQLAlchemy-based%20repositories%2C%20so%20logs%20are%20only%20written%20to%20PostgreSQL%2C%20not%20Aliyun%20SLS.%20The%20Logstore%20repositories%20are%20fully%20implemented%20and%20support%20both%20single-write%20%28SLS%20only%29%20and%20dual-write%20%28SLS%20%2B%20SQL%29%20modes%2C%20but%20you%20must%20explicitly%20configure%20them%20to%20be%20used%20at%20runtime.%0A%0ATo%20enable%20Aliyun%20SLS%20log%20writing%2C%20set%20these%20environment%20variables%20in%20your%20.env%20file%3A%0A%0A%60%60%60env%0ACORE_WORKFLOW_EXECUTION_REPOSITORY%3Dextensions.logstore.repositories.logstore_workflow_execution_repository.LogstoreWorkflowExecutionRepository%0ACORE_WORKFLOW_NODE_EXECUTION_REPOSITORY%3Dextensions.logstore.repositories.logstore_workflow_node_execution_repository.LogstoreWorkflowNodeExecutionRepository%0A%60%60%60%0A%0AMake%20sure%20all%20required%20Aliyun%20SLS%20variables%20are%20set%20%28ALIYUN_SLS_ACCESS_KEY_ID%2C%20ALIYUN_SLS_ACCESS_KEY_SECRET%2C%20ALIYUN_SLS_ENDPOINT%2C%20ALIYUN_SLS_REGION%2C%20ALIYUN_SLS_PROJECT_NAME%29.%20The%20LOGSTORE_DUAL_WRITE_ENABLED%20variable%20controls%20whether%20logs%20are%20written%20to%20both%20SLS%20and%20PostgreSQL%20%28%60true%60%20for%20dual-write%2C%20%60false%60%20for%20SLS%20only%29%C2%A0%E2%80%94%C2%A0it%20defaults%20to%20%60true%60%20for%20safe%20migration%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/.env.example%23L525-L563%29.%0A%0AAfter%20updating%20your%20configuration%2C%20restart%20the%20application.%20New%20workflow%20execution%20and%20node%20execution%20logs%20should%20now%20appear%20in%20Aliyun%20SLS%20in%20real%20time.%20If%20logs%20still%20do%20not%20show%20up%2C%20check%20for%20typos%20in%20the%20class%20paths%2C%20verify%20your%20SLS%20credentials%20and%20permissions%2C%20and%20review%20application%20logs%20for%20errors%20during%20log%20writing%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/blob/9007109a6bf97ddd1766e13313a36d16b6d11182/api/core/repositories/factory.py%23L22-L109%29.%0A%0AThis%20approach%20is%20production-ready%20and%20was%20merged%20to%20address%20performance%20and%20scalability%20issues%20with%20high-volume%20workflow%20logs%20in%20PostgreSQL%C2%A0%5Bcite%5D%28https%3A//github.com/langgenius/dify/pull/28986%29.%20Manual%20testing%20with%20your%20SLS%20credentials%20is%20recommended%20to%20confirm%20the%20integration.) [![Join Discord](https://camo.githubusercontent.com/7d2066700925db1e370d956834f9ea0e5bc92cecbe84963fbd2a363e45091b4e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/a8bd7f3fcf3f5e3bd124eee9ae50ae2ac17b40971726665ac2121d48f9aee155/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/30405) Issue resolved! The provided solution was clear and effective. Thank you for your prompt assistance and for maintaining this great project!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21380