log level 'info' appears to truncate log files at 1MB

90 views
Skip to first unread message

Dave Morse

unread,
Jul 21, 2017, 1:14:50 PM7/21/17
to Canvas LMS Users
We recently switched to log level 'info', because the default log level ('debug') was filling up our disks too fast. When we did this, we noticed that log files seem to get deleted soon after passing 1MB in file size. That's not what we wanted!

In logging.yml, if I change the two occurrences of "log_level: info" back into "log_level: debug" then the behavior stops, but the logs contain too much information too quickly, and outruns our logrotation script.

Is there some way I can get both terse logs and logs that can grow beyond 1MB? I can't find logging.yml documentation beyond a few posts to this list.


config/logging.yml:
development:
  logger: rails
  log_context: false
  log_level: debug

test:
  log_level: debug
  logger: rails

production:
  logger: rails
  log_level: info

staging:
  logger: rails
  log_level: info

A log of the log deletion in progress - I listed prodcution.log's file size every 10 seconds, here you can see it's size grow slowly, then collapse, then begin growing again:
 
-rw-r--r-- 1 ubuntu ubuntu 985905 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 1016576 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 1040053 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 2699 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 9779 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 21394 Jul 21 16:19 production.log
-rw-r--r-- 1 ubuntu ubuntu 31503 Jul 21 16:20 production.log

nicol...@gmail.com

unread,
Apr 9, 2021, 5:03:51 PM4/9/21
to Canvas LMS Users
This is an old thread but still valid for me: how can I avoid the log files being truncated at 1MB?
Reply all
Reply to author
Forward
0 new messages