Logs do not include current day #5110

Closed
opened 2026-02-21 18:09:26 -05:00 by yindo · 2 comments
Owner

Originally created by @nsvrana on GitHub (Aug 19, 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.7.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Filter logs in the log viewer does not show the current day for any option unless "All time" is selected.

✔️ Expected Behavior

Users would expect options to go up to the current moment, not to the beginning of the day.

Actual Behavior

Logs from the current date are not shown unless "all time" is selected.

Originally created by @nsvrana on GitHub (Aug 19, 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)). - [ ] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Filter logs in the log viewer does not show the current day for any option unless "All time" is selected. ### ✔️ Expected Behavior Users would expect options to go up to the current moment, not to the beginning of the day. ### ❌ Actual Behavior Logs from the current date are not shown unless "all time" is selected.
yindo added the 🐞 bug label 2026-02-21 18:09:26 -05:00
yindo closed this issue 2026-02-21 18:09:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 19, 2024):

The issue you're experiencing with logs not including the current day unless "All time" is selected might be related to how the time periods are defined in the log filtering functionality. The TIME_PERIOD_LIST array in the Filter component specifies time periods, but it may not account for the current day's logs correctly.

Here's the relevant code snippet for the time periods:

export const TIME_PERIOD_LIST = [
  { value: 0, name: 'today' },
  { value: 7, name: 'last7days' },
  { value: 28, name: 'last4weeks' },
  { value: today.diff(today.subtract(3, 'month'), 'day'), name: 'last3months' },
  { value: today.diff(today.subtract(12, 'month'), 'day'), name: 'last12months' },
  { value: today.diff(today.startOf('month'), 'day'), name: 'monthToDate' },
  { value: today.diff(today.startOf('quarter'), 'day'), name: 'quarterToDate' },
  { value: today.diff(today.startOf('year'), 'day'), name: 'yearToDate' },
  { value: 'all', name: 'allTime' },
]

The value for 'today' is set to 0, which might be causing the issue. You may need to adjust the logic to ensure that logs from the current day are included properly.

Additionally, ensure that the log fetching functions are correctly handling the date ranges. The functions responsible for fetching logs include fetchWorkflowLogs, fetchAgentLogDetail, fetchChatConversations, and fetchCompletionConversations [1][2].

You might want to review and adjust these components and functions to ensure they correctly handle the current day's logs.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 19, 2024): <!-- Answer --> The issue you're experiencing with logs not including the current day unless "All time" is selected might be related to how the time periods are defined in the log filtering functionality. The `TIME_PERIOD_LIST` array in the `Filter` component specifies time periods, but it may not account for the current day's logs correctly. Here's the relevant code snippet for the time periods: ```tsx export const TIME_PERIOD_LIST = [ { value: 0, name: 'today' }, { value: 7, name: 'last7days' }, { value: 28, name: 'last4weeks' }, { value: today.diff(today.subtract(3, 'month'), 'day'), name: 'last3months' }, { value: today.diff(today.subtract(12, 'month'), 'day'), name: 'last12months' }, { value: today.diff(today.startOf('month'), 'day'), name: 'monthToDate' }, { value: today.diff(today.startOf('quarter'), 'day'), name: 'quarterToDate' }, { value: today.diff(today.startOf('year'), 'day'), name: 'yearToDate' }, { value: 'all', name: 'allTime' }, ] ``` The `value` for 'today' is set to `0`, which might be causing the issue. You may need to adjust the logic to ensure that logs from the current day are included properly. Additionally, ensure that the log fetching functions are correctly handling the date ranges. The functions responsible for fetching logs include `fetchWorkflowLogs`, `fetchAgentLogDetail`, `fetchChatConversations`, and `fetchCompletionConversations` <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/app/log/filter.tsx)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/service/log.ts)</sup>. You might want to review and adjust these components and functions to ensure they correctly handle the current day's logs. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 19, 2024):

Was it included in the previous version?

@crazywoola commented on GitHub (Aug 19, 2024): Was it included in the previous version?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5110