Project

General

Profile

Actions

Defect #6135

closed

Default logger configuration grows without bound.

Added by T. Hauptman over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Documentation
Target version:
Start date:
2010-06-17
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed
Affected version:

Description

A naive installation of redmine (following the install instructions) leaves logfiles in an unexpected place, growing without limit. This can cause problems for the system admin.

A solution was proposed in Defect #5706 but not accepted.

Another solution is given in http://www.redmine.org/boards/2/topics/11836 which seems to not conflict with the issues in #5706.

Consider adding a line to $REDMINE_ROOT/config/environments/production.rb
config.logger = Logger.new(config.log_path, 2, 1048576)

This maintains the :info useful for debugging but limits the impact of the logfile on the system.

Those developing redmine can choose an appropriate logfile max-size. Any finite size is fine but consider using the smallest reasonable size to be kind to webappliance installations...


Related issues

Related to Redmine - Defect #5706: Default config.log_level is too verbose for productionClosed2010-06-17

Actions
Actions #1

Updated by Felix Schäfer over 13 years ago

Mmh, I thought the docs had been updated to reflect that… IIRC the rationale for not including what you propose is that we don't want to impose any rotation scheme on anyone, everyone potentially having different requirements. The other point was that you should already have some kind of logrotate installed and should configure it for that.

I think you could also add a new logger configuration in the config/additional_environment.rb instead of the other file, thus you'd have it local only and wouldn't be affected by updates.

Anyway, could you update the installation guides to make a note where the logs are and that they might grow rapidly depending on usage and should be taken into a logrotate or whatever?

Actions #2

Updated by T. Hauptman over 13 years ago

  • Status changed from New to Resolved

Personally I think that defaulting a configuration that is sane, even if it's nerf, is better in the long run. Power admins can always tweak it to match their optimized system. The rest of us want to install as quickly as possible with the least amount of reading and just have it work...

Regardless I've added a note to the installation page. I don't have time to do a patch for additional_environment.rb.example... Would you be able to add that line?

Cheers

Actions #3

Updated by Felix Schäfer over 13 years ago

T. Hauptman wrote:

Personally I think that defaulting a configuration that is sane, even if it's nerf, is better in the long run. Power admins can always tweak it to match their optimized system. The rest of us want to install as quickly as possible with the least amount of reading and just have it work...

I believe that's been discussed already, I too was in favor of a default rotation, but the arguments against it won.

Regardless I've added a note to the installation page. I don't have time to do a patch for additional_environment.rb.example... Would you be able to add that line?

Very good, thanks a lot. I'll see if the file is one we modify in some way or if it's shipped vanilla from rails, if the later's the case I think we'll keep it from upstream.

Actions #4

Updated by Felix Schäfer over 13 years ago

  • Category set to Documentation
  • Assignee set to Felix Schäfer
Actions #5

Updated by Eric Davis over 13 years ago

Felix,

If you can get me a working config for additional_configuration.rb, I can document it in there as an example too.

For anyone that needs it, this is the log rotation setup I run in production:

/home/websites/projects.littlestreamsoftware.com/shared/log/*.log {

  daily

  missingok

  compress

  delaycompress

  sharedscripts

  postrotate
    touch /home/websites/projects.littlestreamsoftware.com/current/tmp/restart.txt
  endscript
}
Actions #6

Updated by Felix Schäfer over 13 years ago

The OP had already edited the wiki-page RedmineInstall, my config in additional_environment.rb is:

# Use the log-rotation from logger
config.logger = Logger.new(config.log_path, 7, 1048576)
config.logger.level = Logger::INFO
Actions #7

Updated by Felix Schäfer over 13 years ago

  • Status changed from Resolved to New
  • Assignee deleted (Felix Schäfer)

Eric: This one's lingering in my list, the documentation for config/environments/production.rb would be:

# Rotate logs bigger than 1MB, keeps no more than 7 rotated logs around.
#config.logger = Logger.new(config.log_path, 7, 1048576)

More info about Logger here: http://ruby-doc.org/core/classes/Logger.html.

Actions #8

Updated by Eric Davis over 13 years ago

  • Assignee set to Eric Davis
Actions #9

Updated by Eric Davis over 13 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.2
  • Resolution set to Fixed

Updated the documentation in r4096. Thanks Felix.

Actions #10

Updated by Eric Davis over 13 years ago

  • Status changed from Resolved to Closed

Merged into 1.0-stable for release in 1.0.2

Actions #11

Updated by Wicola Lation over 13 years ago

Felix Schäfer wrote:

The OP had already edited the wiki-page RedmineInstall, my config in additional_environment.rb is:

1 # Use the log-rotation from logger
2 config.logger = Logger.new(config.log_path, 7, 1048576)
3 config.logger.level = Logger::INFO

The wiki-page RedmineInstall has to be updated with the 'config.logger.level' line as well. This is important, because otherwise the log level defaults back to :DEBUG.

See http://www.redmine.org/boards/2/topics/11836.

Actions #12

Updated by Felix Schäfer over 13 years ago

  • Status changed from Closed to Reopened

Eric: The loglevel seems to get cleared when you specifiy a new logger, or the new logger doesn't get passed what is already configured for the default logger. Either way, could you add a corresponding note to the config/environments/production.rb? Thanks.

Actions #13

Updated by Eric Davis over 13 years ago

  • Status changed from Reopened to Resolved
  • % Done changed from 0 to 100

Thanks, I added some documentation about the log level in r4182

Actions #14

Updated by Eric Davis over 13 years ago

  • Status changed from Resolved to Closed

Merged into 1.0-stable

Actions #15

Updated by Toshi MARUYAMA almost 10 years ago

  • Related to Defect #5706: Default config.log_level is too verbose for production added
Actions

Also available in: Atom PDF