Logging configuration

Added by Lu Pa about 8 years ago

Hi all... i'm trying to make work redmine logging system. My configuration file (additional_environment.rb) look like this:

config.log_level = :info

and don't work. When I try with this, official installation doc, redmine hangs up.

Replies (5)

RE: Logging configuration - Added by André Bachmann about 8 years ago

Well you should add the following to your additional_environment.rb:

config.logger = Logger.new(config.log_path, 2, 1000000)
config.logger.level = Logger::INFO

And this works for me.

RE: Logging configuration - Added by Lu Pa about 8 years ago

I think your configuration brokes redmine 1.2.1.stable.6263

But I'm solved.. and I'm not sure how. I think it was a file system permissions problem.

RE: Logging configuration - Added by Pavel Potcheptsov over 6 years ago

how to rotate production.log in 2.2.0?
old method don't work:

config.logger = Logger.new(config.log_path, 7, 1024000)
config.logger.level = Logger::WARN

new one work, but without rotation:
config.log_level = :warn

what should I add to second config to rotate logs?

RE: Logging configuration - Added by Diego Fernández over 6 years ago

Hi,
Sorry for my very bad english.
I'm using standard lograte on my Redmine linux server for rotate redmine production.log.
This is my configuration:
Create file /etc/logrotate.d/redmine
/path/to/your/redmine/log/production.log {
daily
missingok
rotate 31
compress
delaycompress
notifempty
copytruncate
} ****
This configuration rotate daily (you can change to weekly, monthly, etc...), 31 old files, and compress old logs except last rotate (for easy access).
To test configuration you can run:
sudo /usr/sbin/logrotate -f /etc/logrotate.d/redmine

Regards,
Diego

RE: Logging configuration - Added by Amit Pustode 3 months ago

Hi,

I configured above same configuration.. but its not working for me ...
Logrotate File created like- production.log.1 , production.log.2 but logs not stored in that file.
Still logs stored in production.log file only ..

/usr/share/redmine/log/production.log {
daily
missingok
rotate 4
delaycompress
notifempty
copytruncate
su www-data www-data
}

I am also attachment Screenshot.

Regard,
-Amit

LogConfig.png (11.8 KB)

logs.png (43.1 KB)

(1-5/5)