プロジェクト

全般

プロフィール

Vote #67868

完了

Default logger configuration grows without bound.

Admin Redmine さんが4年以上前に追加. 4年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Documentation_24
対象バージョン:
開始日:
2010/06/17
期日:
進捗率:

100%

予定工数:
category_id:
24
version_id:
24
issue_org_id:
6135
author_id:
18996
assigned_to_id:
5
comments:
15
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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...


journals

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?
--------------------------------------------------------------------------------
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

--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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:

<pre>
/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
}
</pre>
--------------------------------------------------------------------------------
The OP had already edited the wiki-page [[RedmineInstall#Logger-Configuration]], my config in @additional_environment.rb@ is:

<pre><code class="ruby"># Use the log-rotation from logger
config.logger = Logger.new(config.log_path, 7, 1048576)
config.logger.level = Logger::INFO</code></pre>
--------------------------------------------------------------------------------
Eric: This one's lingering in my list, the documentation for @config/environments/production.rb@ would be:

<pre><code class="ruby"># Rotate logs bigger than 1MB, keeps no more than 7 rotated logs around.
#config.logger = Logger.new(config.log_path, 7, 1048576)</code></pre>

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

--------------------------------------------------------------------------------
Updated the documentation in r4096. Thanks Felix.
--------------------------------------------------------------------------------
Merged into 1.0-stable for release in 1.0.2
--------------------------------------------------------------------------------
Felix Schäfer wrote:
> The OP had already edited the wiki-page [[RedmineInstall#Logger-Configuration]], my config in @additional_environment.rb@ is:
>
<pre>
1 # Use the log-rotation from logger
2 config.logger = Logger.new(config.log_path, 7, 1048576)
3 config.logger.level = Logger::INFO
</pre>

The wiki-page [[RedmineInstall#Logger-Configuration]] 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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Thanks, I added some documentation about the log level in r4182
--------------------------------------------------------------------------------
Merged into 1.0-stable
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,5706,Default config.log_level is too verbose for production

Admin Redmine さんが4年以上前に更新

  • カテゴリDocumentation_24 にセット
  • 対象バージョン1.0.2_24 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0