log file is showing no error message

August 4, 2019 196 views
Ruby on Rails Ubuntu 18.04

hello,
In my rails app i have cleaned up my production.log file.
and now the log file is showing no error message.
what should i do?

3 Answers
Kdimitrov August 4, 2019
Accepted Answer

Hello,

Do you by any chance have any logging related values set in config/environments/production.rb ?

If you haven’t made any changes, the default should be:

config.log_level = :info
RAILS_DEFAULT_LOGGER = Logger.new('log/production.log')

Make sure you haven’t used SyslogLogger as that will log to the OS syslog, not a separate Rails app log, and your application won’t find it. If your logging goes to syslog, the values would look like :

config.log_level = :info
RAILS_DEFAULT_LOGGER = SyslogLogger.new('example.com-production')
  • Thank you
    i have paste this on production.log file.

    config.log_level = :info
    RAILS_DEFAULT_LOGGER = Logger.new('log/production.log')
    

    is it OK?

    and one more thing.
    i have cleaned up the whole production.log file by vim so the file was empty.

@Kdimitrov thank you,
it works.
can i share another problem related to rails?

  • Hello,

    I’m glad to hear it works.

    It would be best to create another question if it’s not related to this one. As soon as you do, I’ll take a look and try to help if I can.

in my rails app,
when i am trying to upload a photo, it is showing the following errors.
Postfeaturedimage Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: You must have ImageMagick or GraphicsMagick installed

should i add this question in a new question?
thank you
@Kdimitrov

  • I assume you already have ImageMagick or GraphicsMagick installed.

    If you do, it might be due to the package libmagickwand-dev not being installed. Can you try and install the package and give it another go?

  • OK,
    I have got the solution,
    i add imagemagic on droplet root and it works.
    thank you

Have another answer? Share your knowledge.