lulalala / multi_logger

Create multiple loggers in Rails
MIT License
59 stars 21 forks source link

add support_environments to options in add_logger #2

Closed guyguyon closed 10 years ago

guyguyon commented 10 years ago

I've added the option support_environments which will create a separate log file to every Rails environment. so for example if Rails.env == 'development', multi_logger will create mail_development.log file

lulalala commented 10 years ago

Thanks for the pull-request!

I feel that not often do I have the need to know what environment the log is generated from, because logs from different environments almost always reside in different physical locations.

Can you try using the undocumented :path option to set the path explicitly?

MultiLogger.add_logger('mail', formatter:formatter, path:"mail_#{Rails.env}") 
guyguyon commented 10 years ago

thanks! i haven't seen that option. I think it's better than my solution