Rotating logs; what postrotate should I use?
Added by Fredrik Liljegren over 16 years ago
I'm rotating redmines logs with logrotate. Redmine continues writing to the renamed files; what should I use for postrotate?
Restart works off course, but seems a little overkill...?
/F
Replies (6)
RE: Rotating logs; what postrotate should I use?
-
Added by Felix Schäfer over 16 years ago
That really depends what middleware you are using to serve redmine (mongrel, thin, passenger, fcgi, …?), but I'd rather recommend using the "rails" way than to use logrotate. Have a look at the Logger docs http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/, especially the new method with which you can define sizes and/or rotate times, this then goes in your environment.rb (or specific environment files).
My config looks like this:
RE: Rotating logs; what postrotate should I use?
-
Added by Wicola Lation about 16 years ago
I had a problem when I tried adding the following line as suggested:
I tried adding the line (separately) to- config/environments/production.rb
- config/additional_environment.rb
- config/environment.rb
With the addition, my production.log behaves as though the log level is set to :debug (tons of logging results). This is the case even if I set the config.log level to :warn, :info or :error (in any of the above .rb files).
Is anyone facing the same problem?
RE: Rotating logs; what postrotate should I use?
-
Added by Wicola Lation about 16 years ago
Yes, your fix works! Will open the ticket as requested.
Actually I did tried setting the log level before I posted my problem, only that I did it wrongly by writing
instead of
I had thought using the syntax given in config/environment would work, didn't know there's a difference.
RE: Rotating logs; what postrotate should I use?
-
Added by adrian perez about 5 years ago
bruno paulino wrote:
I am currently running Redmine 4.1.1 at our company and the configuration has changed a little:
[...]
Thanks man! It works perfectly