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 rotate has some problem in 3.7.4 version #1276
Comments
Are you using a subclass of The default log file name uses the following pattern as log file name: " .log" Also, if you override |
Thanks @ffried , The date format is wrong, I need to change from YYYY to yyyy. |
@ffried :
Below is newLogFileName and isLogFile implementation.
PS. This issue will not happen, If I do not restart my app, ex, I keep running my app from 20220107 to 20220110, It will generate three log files. The log module works as expectation. |
@ffried hi,I meet this problem. when I use pod 'CocoaLumberjack/Swift', '3.7.0',the swift project can rotate after 24 hours. But pod 'CocoaLumberjack', '3.7.2' or '3.7.4',the objective c project cann't rotate after 24 hours. I don't know why. I just guess maybe dispatch_time? or different between dispatch_time and dispatch_walltime ? Could you give me some help or suggestion? thanks. |
I do like oyljerry, but |
@oyljerry hi ,Could you give some advices or tell me how you fix it ?thank you very much. |
@oyljerry @coolwuzizai I just went through all the changes since 3.7.0 and I really can't seem to figure out what's wrong. Could you guys give |
@ffried thanks,I will test for the master. oh,I remember something,when I set fileLogger.rollingFrequency = 60 * 3 (test for three minutes or ten minutes,it works ! But when set 60 * 60 * 24, cann't rotate ,so I guess the dispatch_time because dispatch_time will stop when computer is sleep). But if I restart the app after rollingFrequency, it sometimes create a new LogFile. |
@ffried hi,I find a problem 16 days ago the old version. I set fileLogger.maximumFileSize = 50 * 1024 * 1024; |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contribution. |
I found the same problem with version 3.8.1,this is my configuration,but in reality, every time you reopen the app, it generates a new file.
|
Can you guys try the latest |
I use the latest master code and this problem no longer occurs, thanks😊 |
Thanks for confirming. Then this is finally fixed. |
Issue Info
Issue Description and Steps
I have just upgraded CocoaLumberjack from 3.7.2 to 3.7.4, But I found there is some strange problems occur.
Below is code about how to control log rotate.
Issuer#1:
I found that the log is rotated when its size is only 1.3M, In 3.7.2, This works as 20M.
Issuer#2:
The log file which should be xxx-202112291336.log, but it has been changed to xxx-202212291336.log
Is this issue related to #1234???
The text was updated successfully, but these errors were encountered: