Don't log to STDOUT on production.

- Added a condition to not set the logger on production environment.
- Created a spec with three scenarios to cover all cases:
-- With no extra configuration.
-- Where rake is define.
-- When on production.