Skip to content

fix: [#664] resolve date mismatch between log file name and log entries#1020

Merged
almas-x merged 1 commit intomasterfrom
almas/#664
Apr 29, 2025
Merged

fix: [#664] resolve date mismatch between log file name and log entries#1020
almas-x merged 1 commit intomasterfrom
almas/#664

Conversation

@almas-x
Copy link
Contributor

@almas-x almas-x commented Apr 29, 2025

📑 Description

Closes goravel/goravel#664

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings April 29, 2025 02:44
@almas-x almas-x requested a review from a team as a code owner April 29, 2025 02:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a date mismatch issue by aligning the log file name dates with the log entry dates through correcting the clock initialization.

  • Moves from using the system's default timezone to fetching the application timezone from configuration.
  • Updates the clock creation to utilize the app-specific timezone.
Comments suppressed due to low confidence (1)

log/logger/daily.go:47

  • No tests appear to cover the new timezone behavior. Adding tests to validate correct log date alignment across different time zones would improve confidence in this fix.
rotatelogs.WithClock(rotatelogs.NewClock(carbon.Now(daily.config.GetString("app.timezone")).StdTime())),

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.99%. Comparing base (ee0bc55) to head (aecd011).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
foundation/application.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1020      +/-   ##
==========================================
+ Coverage   70.97%   70.99%   +0.01%     
==========================================
  Files         170      170              
  Lines       11705    11701       -4     
==========================================
- Hits         8308     8307       -1     
+ Misses       3044     3042       -2     
+ Partials      353      352       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +21 to +23
mockConfig := mocksconfig.NewConfig(t)
mockConfig.EXPECT().GetString("logging.default").Return("test").Once()
mockConfig.EXPECT().GetString("logging.channels.test.driver").Return("single").Once()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR 👍

@almas-x almas-x merged commit 35ac966 into master Apr 29, 2025
12 of 13 checks passed
@almas-x almas-x deleted the almas/#664 branch April 29, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date mismatch between log file name and log entries

3 participants