Blankman
Blankman

Reputation: 267370

Why is my deployed rails app writing to a production.log file?

Where in my configuration does it say to write to a production.log file?

What is the best practise for this, to log critical errors only I'm guessing, how would I do that?

Upvotes: 1

Views: 739

Answers (1)

Joshua Partogi
Joshua Partogi

Reputation: 16435

By default the log file is a convention from the environment name. So in production environment the log will be named production.log, in development it is called development.log.

You can override the log file name and the log level for production in config/environments/production.rb by putting the lines below.

config.log_level = :error # this will the rails to log error only in production
config.log_path = log/something_else.log # defaults to log/#{environment}.log

Upvotes: 4

Related Questions