我有一个巨大的Rails应用程序日志。这是正常的吗?' 768 megs为生产日志!我有巨大的Rails日志是否正常?
[email protected]:/home/canvas/canvas/log# ls -lh
total 960M
-rw-r--r-- 1 canvas canvas 192M Sep 28 12:37 delayed_job.log
-rw-rw-r-- 1 canvas canvas 265 Sep 22 08:57 development.log
-rw-r--r-- 1 canvas canvas 910K Sep 28 12:36 newrelic_agent.log
-rw-r--r-- 1 canvas canvas 768M Sep 28 12:37 production.log
-rw-r--r-- 1 root root 26K Sep 28 11:00 super_delayed_job_err.log
-rw-r--r-- 1 root root 113K Sep 22 14:07 super_delayed_job.log
片段从日志文件: [ - 1e1f92f0-293e-0132-2906-00163c067c2e]缓存命中:_account_lookup2/1({}) [ - 1e1f92f0-293e-0132-2906-00163c067c2e]缓存命中:settings_for_plugin2 /会话({}) [ - 208bd370-293e-0132-2906-00163c067c2e]
Processing UsersController#user_dashboard (for 54.248.250.232 at 2014-09-28 14:06:04) [GET]
[- 208bd370-293e-0132-2906-00163c067c2e] Parameters: {"controller"=>"users", "action"=>"user_dashboard"}
[- 208bd370-293e-0132-2906-00163c067c2e] Redirected to http://subdomain.example.com/login
[- 208bd370-293e-0132-2906-00163c067c2e] Filter chain halted as [:require_user] rendered_or_redirected.
[- 208bd370-293e-0132-2906-00163c067c2e] Completed in 3ms (DB: 0) | 302 Found [http://demo3.iqraalms.com/]
[- 208bd370-293e-0132-2906-00163c067c2e] [STAT] 903612 903612 0 903612 0.010000000000000231 0
任何想法如何优化呢?
好吧,如果你的应用程序获得的流量,这是完全正常的日志变得非常大。您应该使用'logrotate'实用程序,以便根据您的需要每日或每周轮换您的日志。 http://linux.die.net/man/8/logrotate – sjaime 2014-09-28 13:52:53