Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log not registering in production #11

Open
alfo opened this issue Aug 7, 2014 · 3 comments
Open

Log not registering in production #11

alfo opened this issue Aug 7, 2014 · 3 comments

Comments

@alfo
Copy link

alfo commented Aug 7, 2014

In development, everything works as expected. However, when I deploy to a Dokku instance, I have a problem that the method is not added to Logger.

Steps to reproduce (rails console production):

MultiLogger.add_logger('xxx')
=> #<Logger:0x007f935d1ce038 @progname=nil, @level=0, @default_formatter=#<Logger::Formatter:0x007f935d1ce010 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x007f935d1cdfc0 @shift_size=1048576, @shift_age=0, @filename="/app/log/xxx.log", @dev=#<File:/app/log/xxx.log>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x007f935d1cdf98 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f935d1cdf48>>>>

Rails.logger.xxx.info "Something"
=> NoMethodError: undefined method `xxx' for #<Logger:0x007f935de0d1f0>

The log file log/xxx.log is created in production, but nothing is written to it other than

# Logfile created on 2014-08-07 08:20:42 +0000 by logger.rb/44203

Any ideas?

@lulalala
Copy link
Owner

lulalala commented Aug 8, 2014

I can't reproduce this in production. Can you give your Rails version and run the following in console?

puts MultiLogger.get_rails_logger_class
puts Rails.logger

@kyledcline
Copy link

@lulalala Not OP, but I am having the same issue when deploying to a Heroku instance on Rails 4.1.7.

puts MultiLogger.get_rails_logger_class
ActiveSupport::Logger
=> nil

puts Rails.logger
#<Logger:0x007f13e617fcb8>
=> nil

@Jedidiah
Copy link

+1
Also not the OP, but having the same problem (works in development but not production) and getting the same output as @kyledcline when putting the values you asked for.

Using Rails 4.2.3 and Ruby 2.1.6p336

Edit, should say this isn't a Heroku instance, I'm just deploying to a Centos server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants