title: Celery logging to file from inside the Django modules
body: <p>I have the following in my <code>tasks.py</code></p>
  
  <pre><code>from celery.utils.log import get_task_logger
  logger = get_task_logger("celery.task")
  </code></pre>
  
  <p>I have setup logging for <code>celery.task</code> in my <code>settings.py</code> and all the log from my <code>tasks.py</code> file are properly logged to file.</p>
  
  <p>I have Django modules. These modules can be called directly from Django or by a Celery task. What I want is, if the module is called by Django, then logs should go to Django log file. If the module is called by a task, the log should go to celery task logger.</p>
  
  <p>Example:</p>
  
  <pre><code># tasks.py
  
  from app.foo import MyFoo
  
  @task(name="bar")
  def boo():
      MyFoo.someFoo()
  
  # app.foo.py
  
  log = logging.getLogger(__name__)
  </code></pre>
  
  <p>I want the log messages inside MyFoo to go to celery log when run by a worker task.</p>
  
  <p>Any ideas?</p>