Reputation: 1829
I'm creating a rotating logger for my staging and production environment. So I've written the following code:
config.logger = Logger.new(config.log_path, 2 , 'daily')
Now my question is how do you get the log_path, can you dynamically link it depending on the current env? My logs are located in log/ (default path I think) and the file is staging.log / production.log depending on te env.
Kind regards
Upvotes: 2
Views: 2750
Reputation: 1829
Found this quick fix solution:
Rails.root.join('log',"#{Rails.env}.log")
Wondering if there's a better one.
Upvotes: 2