Project

General

Profile

Logging not working

Added by Dmitry Tsaryov almost 9 years ago

Hello.
I got problem with access to some pages like my/account, setting, also I can't add new user. Every time I get 500 server error. System suggests me to see info in logs.
But my logging is not working. File /log/production.log is not updating. I googled this problem, but I still got no results.

I created file /config/additional_environment.rb with text
config.log_level = :debug

Then I changed text to this
config.logger = Logger.new(config.log_path, 2, 1000000)
config.logger.level = Logger::DEBUG

but I got problem "Application can not start".

Environment:
Redmine version 2.5.0.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 3.2.17
Environment production
Database adapter Mysql2
SCM:
Filesystem
Redmine plugins:
no plugin installed

Ubuntu 13.10


Replies (5)

RE: Logging not working - Added by Leonel Iturralde almost 9 years ago

Hi,
you can try changing

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

to
config.logger = Logger.new('log/logfile.log', 2, 1000000)

.
Logs will be in the same folder where production.log is.

RE: Logging not working - Added by Dmitry Tsaryov almost 9 years ago

Hi, thanks
I know that i should change config.log_path to 'log/mylog.log' but i still got problems.

The problem has been solved that way: i just gave permission my all my redmine directory
chmod -R 777 /usr/share/redmine

RE: Logging not working - Added by Pavel Potcheptsov almost 9 years ago

Instead of

chmod -R 777 /usr/share/redmine

you should look who is the owner of your web-server (apache, www-data, etc)
and make
chown -R apache:root /usr/share/redmine
chmod -R 766 /usr/share/redmine

RE: Logging not working - Added by Toshi MARUYAMA almost 9 years ago

Pavel Potcheptsov wrote:

chmod -R 766 /usr/share/redmine

I think it is 755 or 775, not 766.

RE: Logging not working - Added by Pavel Potcheptsov almost 9 years ago

Sure, Read and Execute for group and others.
It was my mistake.

    (1-5/5)