How to add the file name and line number in Rails' log message? My current format is something like
[INFO : 12-09-27 10:12:30]
I want to change it to
[INFO: 12-09-27 10:12:30 application_controller.rb:35]
or something like this. Any ideas?
How to add the file name and line number in Rails' log message? My current format is something like
[INFO : 12-09-27 10:12:30]
I want to change it to
[INFO: 12-09-27 10:12:30 application_controller.rb:35]
or something like this. Any ideas?
In case any one is looking for a similar solution for Rails 4. It would be:
Create an initializer
logger.rb
in yourconfig/initializers
directory and try putting thisShould work on Ruby 1.9+