title: Defining a logger in environment.rb does not work
body: <p>I am trying to make a custom logger. I read elsewhere that I can define my logger in environment.rb and use it in other files.</p>
  
  <p>I have in environment.rb:</p>
  
  <pre><code># Load the rails application
  require File.expand_path('../application', __FILE__)
  
  my_logger = Logger.new("#{Rails.root}/log/my.log")
  my_logger.formatter = Logger::Formatter.new
  
  
  # Initialize the rails application
  MyApp::Application.initialize!
  </code></pre>
  
  <p>And I call the logger from, for example, a controller:</p>
  
  <pre><code>    my_logger.info "got here"
  </code></pre>
  
  <p>However, I obtain the error:</p>
  
  <blockquote>
    <p>Undefined local variable or method `my_logger' for </p>
  </blockquote>
  
  <p>Any clues as to why this could be happening? Thanks!</p>