In logging and annotation, the log is empty with no records after being opened. #6774

Closed
opened 2026-02-21 18:17:14 -05:00 by yindo · 5 comments
Owner

Originally created by @liuxiaochenlcx on GitHub (Nov 14, 2024).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Using Docker Compose to newly deploy the latest version of Dify on the company’s virtual machine.
Import the previous DSL and call it normally via the API.
After the call, click on Logging and Annotation, then click on a log entry.

✔️ Expected Behavior

There should be call details displayed.

Actual Behavior

b5e5dd46380d2b5011337439d776265
Originally created by @liuxiaochenlcx on GitHub (Nov 14, 2024). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Using Docker Compose to newly deploy the latest version of Dify on the company’s virtual machine. Import the previous DSL and call it normally via the API. After the call, click on Logging and Annotation, then click on a log entry. ### ✔️ Expected Behavior There should be call details displayed. ### ❌ Actual Behavior <img width="956" alt="b5e5dd46380d2b5011337439d776265" src="https://github.com/user-attachments/assets/3a7f67af-c0ef-465d-8e0e-ad3189266405">
yindo added the 🐞 bugstale labels 2026-02-21 18:17:14 -05:00
yindo closed this issue 2026-02-21 18:17:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 14, 2024):

Hello, @liuxiaochenlcx! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve the issue you're experiencing.

I couldn't find a specific solution to the issue of empty logs in Dify version 0.11.1. However, there are some related discussions and issues that might be helpful:

  1. A similar issue was discussed in this thread, where users faced problems with log files in Docker. Although this discussion is unsolved, it might provide some insights or similar experiences.

  2. There was an issue with logging in Docker Compose for version 0.6.9, which was resolved by initializing the logging configuration before any other log configurations. You can find the details of the solution in this issue. Although this is for an earlier version, the approach might be applicable or provide a starting point for troubleshooting.

For Dify version 0.11.1, ensure that your logging configurations in the docker-compose.yaml file are correctly set up. The configurations include settings for LOG_LEVEL, LOG_FILE, LOG_FILE_MAX_SIZE, LOG_FILE_BACKUP_COUNT, LOG_DATEFORMAT, and LOG_TZ [1][2].

If the problem persists, you might want to check the logging handlers and dependencies used in Dify, such as RotatingFileHandler and pytz for timezone handling [3]. These components could be relevant to the issue you're experiencing.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 14, 2024): <!-- Greeting --> Hello, @liuxiaochenlcx! I'm here to assist you with any bugs, questions, or contributions you may have. Let's work together to resolve the issue you're experiencing. <!-- Answer --> I couldn't find a specific solution to the issue of empty logs in Dify version 0.11.1. However, there are some related discussions and issues that might be helpful: 1. A similar issue was discussed in [this thread](https://github.com/langgenius/dify/discussions/9845), where users faced problems with log files in Docker. Although this discussion is unsolved, it might provide some insights or similar experiences. 2. There was an issue with logging in Docker Compose for version 0.6.9, which was resolved by initializing the logging configuration before any other log configurations. You can find the details of the solution in [this issue](https://github.com/langgenius/dify/issues/4990). Although this is for an earlier version, the approach might be applicable or provide a starting point for troubleshooting. For Dify version 0.11.1, ensure that your logging configurations in the `docker-compose.yaml` file are correctly set up. The configurations include settings for `LOG_LEVEL`, `LOG_FILE`, `LOG_FILE_MAX_SIZE`, `LOG_FILE_BACKUP_COUNT`, `LOG_DATEFORMAT`, and `LOG_TZ` <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker-legacy/docker-compose.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. If the problem persists, you might want to check the logging handlers and dependencies used in Dify, such as `RotatingFileHandler` and `pytz` for timezone handling <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/extensions/ext_logging.py)</sup>. These components could be relevant to the issue you're experiencing. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Nov 14, 2024):

@xuzuodong

function getThreadMessages(tree: ChatItemInTree[], targetMessageId?: string): ChatItemInTree[] {
  let ret: ChatItemInTree[] = []
  let targetNode: ChatItemInTree | undefined

  // find path to the target message
  const stack = tree.toReversed().map(rootNode => ({
    node: rootNode,
    path: [rootNode],
  }))
  while (stack.length > 0) {
    const { node, path } = stack.pop()!
    if (
      node.id === targetMessageId
      || (!targetMessageId && !node.children?.length && !stack.length) // if targetMessageId is not provided, we use the last message in the tree as the target
    ) {
      targetNode = node
      ret = path.map((item, index) => {
        if (!item.isAnswer)
          return item

        const parentAnswer = path[index - 2]
        const siblingCount = !parentAnswer ? tree.length : parentAnswer.children!.length
        const prevSibling = !parentAnswer ? tree[item.siblingIndex! - 1]?.children?.[0]?.id : parentAnswer.children![item.siblingIndex! - 1]?.children?.[0].id
        const nextSibling = !parentAnswer ? tree[item.siblingIndex! + 1]?.children?.[0]?.id : parentAnswer.children![item.siblingIndex! + 1]?.children?.[0].id

        return { ...item, siblingCount, prevSibling, nextSibling }
      })
      break
    }
    if (node.children) {
      for (let i = node.children.length - 1; i >= 0; i--) {
        stack.push({
          node: node.children[i],
          path: [...path, node.children[i]],
        })
      }
    }
  }

It seems there is something wrong here.

@crazywoola commented on GitHub (Nov 14, 2024): @xuzuodong ``` function getThreadMessages(tree: ChatItemInTree[], targetMessageId?: string): ChatItemInTree[] { let ret: ChatItemInTree[] = [] let targetNode: ChatItemInTree | undefined // find path to the target message const stack = tree.toReversed().map(rootNode => ({ node: rootNode, path: [rootNode], })) while (stack.length > 0) { const { node, path } = stack.pop()! if ( node.id === targetMessageId || (!targetMessageId && !node.children?.length && !stack.length) // if targetMessageId is not provided, we use the last message in the tree as the target ) { targetNode = node ret = path.map((item, index) => { if (!item.isAnswer) return item const parentAnswer = path[index - 2] const siblingCount = !parentAnswer ? tree.length : parentAnswer.children!.length const prevSibling = !parentAnswer ? tree[item.siblingIndex! - 1]?.children?.[0]?.id : parentAnswer.children![item.siblingIndex! - 1]?.children?.[0].id const nextSibling = !parentAnswer ? tree[item.siblingIndex! + 1]?.children?.[0]?.id : parentAnswer.children![item.siblingIndex! + 1]?.children?.[0].id return { ...item, siblingCount, prevSibling, nextSibling } }) break } if (node.children) { for (let i = node.children.length - 1; i >= 0; i--) { stack.push({ node: node.children[i], path: [...path, node.children[i]], }) } } } ``` It seems there is something wrong here.
Author
Owner

@xuzuodong commented on GitHub (Nov 14, 2024):

What browser are you using?

@xuzuodong commented on GitHub (Nov 14, 2024): What browser are you using?
Author
Owner

@xuzuodong commented on GitHub (Nov 14, 2024):

Looks like toReversed is not compatible to your browser.

https://caniuse.com/?search=toreversed

@xuzuodong commented on GitHub (Nov 14, 2024): Looks like `toReversed` is not compatible to your browser. https://caniuse.com/?search=toreversed
Author
Owner

@dosubot[bot] commented on GitHub (Dec 16, 2024):

Hi, @liuxiaochenlcx. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • You reported a bug in Dify version 0.11.1 where logs appear empty in a self-hosted Docker environment.
  • I suggested checking related discussions and ensuring correct logging configurations in the docker-compose.yaml file.
  • @crazywoola provided a code snippet indicating a potential issue.
  • @xuzuodong identified that the toReversed function might not be compatible with your browser and suggested checking browser compatibility.

Next Steps

  • Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting on this issue.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Dec 16, 2024): Hi, @liuxiaochenlcx. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary** - You reported a bug in Dify version 0.11.1 where logs appear empty in a self-hosted Docker environment. - I suggested checking related discussions and ensuring correct logging configurations in the `docker-compose.yaml` file. - @crazywoola provided a code snippet indicating a potential issue. - @xuzuodong identified that the `toReversed` function might not be compatible with your browser and suggested checking browser compatibility. **Next Steps** - Please let us know if this issue is still relevant to the latest version of the Dify repository by commenting on this issue. - If there is no further activity, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6774