Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log doesn't rotate on the end of month #486

Closed
dovholuknf opened this issue Sep 2, 2022 · 5 comments · Fixed by #547
Closed

log doesn't rotate on the end of month #486

dovholuknf opened this issue Sep 2, 2022 · 5 comments · Fixed by #547
Assignees
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest Windows

Comments

@dovholuknf
Copy link
Member

log_utils.c has a problem on end of month. it uses tm_mday to determine if a log roll should occur and at the end of the month the day will be 28/29/30/31 of the 'orig_time' and the next time will be 1 since its' the "day in the month". The logs are still there, but the log file doesn't rotate.

Fix that. See line 112 ish:

        if (orig_time->tm_mday < tm->tm_mday) {
@dovholuknf dovholuknf added bug Something isn't working Windows good first issue Good for newcomers labels Sep 2, 2022
@RAYANI630
Copy link

Assign me this issue. I'll try to resolve it.

@dovholuknf dovholuknf assigned dovholuknf and RAYANI630 and unassigned dovholuknf Sep 28, 2022
@dovholuknf
Copy link
Member Author

Go for it! You can see that on days 28/29/30/31, the next day of the month is 1, and thus that boolean won't be true.

@RAYANI630
Copy link

Will try to generate pr on 1st Oct.

@dovholuknf
Copy link
Member Author

Excellent. Thanks!

szymonnogiec added a commit to szymonnogiec/ziti-tunnel-sdk-c that referenced this issue Nov 7, 2022
Resolves openziti#486. Check also a month and year difference (will prevent a bug where log would
not be rotated at the end of the year).
@szymonnogiec
Copy link
Contributor

Hey, since RAYANI630 hasn't created any PR, I've fixed that #547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants