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 rotate does not work as expected with rails logger #1856

Closed
torebre opened this issue Apr 19, 2021 · 1 comment · May be fixed by #1928
Closed

Log rotate does not work as expected with rails logger #1856

torebre opened this issue Apr 19, 2021 · 1 comment · May be fixed by #1928

Comments

@torebre
Copy link

torebre commented Apr 19, 2021

Summary: Log rotate does not work as expected when using the rails-logger.

Steps to reproduce: Use rails logger and set debug level: The log does not rotate. Set the the log level to something else and the log rotates.

Expected behavior: The log level should not affect the log rotation.

Additional notes: It looks like the level argument is being given as input where the super class expects the shift_age argument to be:

super(log_path, level)

torebre added a commit to torebre/canvas-lms that referenced this issue Aug 21, 2021
… where the shift-argument is expected in the logger.

This commit will cause the logs using the rails logger to no longer rotate no matter what the log level is. Previously the logs would not rotate only if the level was set to debug, because in this case the shift-argument was set to 0. For log level info for example the shift argument would be set to 1, causing the logs to rotate.

Closes instructuregh-1856

Test plan:
- Specify "logger: rails" and "log_level: info" in logging.yml
- Observe that the logs will grow beyond 1 MB
@torebre
Copy link
Author

torebre commented May 15, 2024

This is no longer an issue, canvas_logger.rb has been updated since this issue was opened.

@torebre torebre closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant