Skip to content

Commit

Permalink
Setting level-argument for logger, it was earlier set in the position…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
torebre committed Aug 21, 2021
1 parent 24f52a3 commit 8294598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/canvas_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(log_path, level = DEBUG, options = {})
unless File.exist?(log_path)
FileUtils.mkdir_p(File.dirname(log_path))
end
super(log_path, level)
super(log_path, level: level)
@log_path = log_path
@skip_thread_context = options[:skip_thread_context]
end
Expand Down

0 comments on commit 8294598

Please sign in to comment.